-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(esp_netfi): Add DHCPS option for captive portal identification (IDFGH-11885) #12971
feat(esp_netfi): Add DHCPS option for captive portal identification (IDFGH-11885) #12971
Conversation
👋 Hello jkingsman, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
48c1dac
to
19675b8
Compare
Looks like a nice, additive, patch. I like it! |
Hi @jkingsman Thanks for the PR, but is it really all that's needed for this option to work? Haven't you forgotten to add other files to your commit? I mean, it could work from the |
Hm, adding to the enum so that you can serve that DHCP option seems all that's necessary to me -- it's up to a user to actually write the captive portal, of course; we have no way of knowing what they want for that. Is there something obvious I've missed? I will do up a demo this evening if I can find some time. I'm happy to overwrite that captive portal example if desired, but it uses DNS redirection which is probably a reasonable demo to keep around -- DHCP opt is the better, more modern way to accomplish a redirect but DNS is still a valid approach. Do you have any preferences on overwrite vs. add (and I a suppose perhaps annotate each example to emphasize the different approaches and when they're appropriate for use)? Thanks for the tips! |
This is probably enough for the DHCP client to parse and use it, that is if the ESP32 is connecting to a captive portal. esp-idf/components/lwip/apps/dhcpserver/dhcpserver.c Lines 407 to 456 in 6b9c2fc
It's easy to append more options using the
But that's again, just the lower layer. If you're adding this enum to
It would be great if you use some local |
Ah, that's helpful context; thank you. Seems like I misunderstood how the DHCP system fit together in that regard -- I did indeed intend this as an offer value and not a client value. I'll look into the funcs you linked and get my head around the least invasive way to do this. |
I've got a draft but have just moved states so am waiting for my collection of devices to arrive with our moving van in a few days or so for real testing + sniffing the offer packet for validation. Thanks for your patience! |
d7d4456
to
71278ba
Compare
20351b4
to
4cfbdce
Compare
Alrighty @david-cermak I think this is ready to go. I've validated this with an example, including Per the contributing docs, I also did an Please let me know your feedback and if you want any changes. Thank you again for your patience! |
8e7a672
to
e3938fc
Compare
Thanks for the update @jkingsman ! The changes look very good to me. The only thing is the allocation in the netif layers. Could we let users "own" that buffer, so we just copy the pointer? This would usually be a |
Sounds good! I've moved that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR and the updates. The changes look good to me!
We're moving this PR to the internal pipeline of reviews and tests before merging to master.
This process usually takes some time...
I'd only like to ask you to squash those 4 commits into a single one. (we'd get back to you if there're some issues or any other request for changes)
ece07c8
to
6ffbcdb
Compare
Woohoo! Glad to hear it's made it to the next round. I've squashed down my commits to one, and I'll sit tight. If you have a rough order of magnitude, please, is 'some time' for review usually weeks? Months? No worries no matter what it is; just curious. Thanks again! |
:-) I'd say ~ weeks (1 month on average, but the standard deviation is 'big')
just a typo with your last commit message -> |
DHCP Option 114 provides a modern method of indicating a captive portal redirect to DHCP client. This introduces Option 114 to the DHCPS component as well as provides examples for usage.
6ffbcdb
to
593194d
Compare
Whoops, fixed. Thanks for the info! I will wait to hear more from you when things progress. |
It's been merged and published as 3035ce2 (had to rebase to pass the internal tests, so it didn't close automatically) |
Eyy awesome; thank you!! |
@david-cermak |
RFC 8910 provides a DHCP option to notify clients of a captive portal to be visited prior to using the network.
This is supported by vendors (see Apple since iOS 14 and macOS Big Sur, Android since Android 11), and provides a more standards-compliant mechanism than DNS-based redirection.
This is a simple addition and will be useful in scenarios where the ESP32 broadcasts a network and needs to direct clients to a portal or served content in a modern, standards-compliant way.
This would also address #2723.