-
Notifications
You must be signed in to change notification settings - Fork 168
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
Fully enable IPv6 by configuring DNS (both DHCPv6 Stateless and RDNSS) #166
Fully enable IPv6 by configuring DNS (both DHCPv6 Stateless and RDNSS) #166
Conversation
The PR is also up to fix IPv6-only DNS resolution of dual-stack addresses, by -- if we have a public scope address then checking IPv6 first. espressif/arduino-esp32#9443 The fix requires IPv6 DNS to be enabled (this PR) to be useful. With both changes applied, then almost all IPv6 scenarios work.
The only one that doesn't work is TLS, which requires the ESP-LWIP fix. |
can you please remove the unrelated changes |
Are you talking about the additional logging in the scripts (as echo rather than just a comment)? I was using them to understand the build. Actually, I still can't get it working with my alternate LWIP fix branch -- it gets some strange compile issue related to BlueTooth that seems to have nothing to do with my changes. But I can easily remove them from the PR here. Probably later this evening (my time, which is Brisbane +10) |
Sure thing! Remove them and I will merge it |
… and RDNSS) There are two main IPv6 DNS systems, DHCPv6 Stateless and RDNSS, used in different networks; this change enables both of them. Previously IPv6 was enabled and assigned addresses, via autoconfig Router Advertisement (RA), but did not enable DNS, without which it cannot connect via host names on an IPv6-only network, so was not very useful. There were some mitigations, e.g. you could statitically configure DNS, or if running in a dual-stack network then the IPv4 DNS will return results (including IPv6 addresses), however applications should automatically work across all network types, so the options in this change should be enabled.
cb996d8
to
4a8aa2e
Compare
Actually, it was a small change, just reordering the commits, so just force pushed the change. |
…x IPv6 TLS (espressif#166) TLS / HTTPS uses the hostname (for certificate validation) to directly look up DNS. This change enables the RFC6724 destination address selection in LWIP DNS, to return IPv6 addresses from DNS when a public IPv6 source is available, or otherwise return IPv4. i.e. Destination address selection is dynamci depending on what addresses are available to send from. Without this, LWIP is hard coded to prefer IPv4, which means when an IPv6-only device tries to contact a dual-stack (or DNS64) server, it will get the IPv4 address (that can't be used). The config change fixes that.
…x IPv6 TLS (espressif#166) TLS / HTTPS uses the hostname (for certificate validation) to directly look up DNS. This change enables the RFC6724 destination address selection in LWIP DNS, to return IPv6 addresses from DNS when a public IPv6 source is available, or otherwise return IPv4. i.e. Destination address selection is dynamci depending on what addresses are available to send from. Without this, LWIP is hard coded to prefer IPv4, which means when an IPv6-only device tries to contact a dual-stack (or DNS64) server, it will get the IPv4 address (that can't be used). The config change fixes that.
There are two main IPv6 DNS systems, DHCPv6 Stateless and RDNSS, used in different networks; this change enables both of them, as a network may have either one (or both). In an IPv4-only network, these options will simply be ignored.
This is part of the fix for espressif/arduino-esp32#9143
Previously IPv6 was enabled and assigned addresses, via autoconfig Router Advertisement (RA), but did not enable DNS, without which it cannot connect via host names on an IPv6-only network, so was not very useful.
There were some mitigations, e.g. you could statically configure DNS, or if running in a dual-stack network then the IPv4 DNS will return results (including IPv6 addresses), however applications should automatically work across all network types, so the options in this change should be enabled.
With IPv6 DNS options on in libs, and the other improvements so far in DNS (espressif/arduino-esp32#9439), we have IPv6-only to IPv6-only connections now working:
There are still a few issues to fix in Arduino-ESP32 to get all configurations working:
To properly fix this second issue requires my patch to LWIP, espressif/esp-lwip#66
In the meanwhile, I can add a workaround in Arduino-ESP32, based on the code in my ESP-IDF examples updates: espressif/esp-idf#13250
Here is IPv6 - IPv6 working:
Failure from IPv6-only to dual-stack host, because DNS is returning an IPv4 address, which can't be reached from the IPv6-only network: