-
Notifications
You must be signed in to change notification settings - Fork 73
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
Orders ipv6 addresses before v4 in resolution (needs a happy eyeballs implementation that supports feeding in resolved addresses) #233
Conversation
When performing mdns or dns resolution for a given hostname v4 addresses are always returned for the connection over v6 when an address supports dual stacks. This allows for ipv6 transitioning and testing in a dual stack environment. It also follows common practice when picking the right address to try first. Not addressed by this commit is the ability to fall back to other resolved addresses should the first address fail. This feature is addressed by other todo's in the project.
Here is the logic we use in Home Assistant Core to get the preferred ip. We tried to return IPv6 first but it caused too many problems for users
|
1 similar comment
Here is the logic we use in Home Assistant Core to get the preferred ip. We tried to return IPv6 first but it caused too many problems for users
|
Thanks @bdraco for the information. Are you able to provide a link to the code in ha core? Are you able to elaborate on the problems faced when preferring v6 over v4 first in a dual stack environment? This method is considered the best practice in RFC's. I know from my own personal env I would prefer it if HA would be more v6 first. Makes it very hard to go completely single stack for IOT devices. |
Lots of users have broken IPv6. The issue queue in HA is full of them.
If we were to do IPv6 we would need to implement happy eyeballs https://en.wikipedia.org/wiki/Happy_Eyeballs |
zeroconf now has a guarantee on ip address order return that matches the above pattern. This should make it a lot simpler. https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.create_connection We can drop |
@tlm Is this something you are still interested in pursuing? |
@bdraco It is, but not something I have the time to finish up at the moment. Happy to close and I can breathe some more life into this another day. |
We effectively have same problem as aio-libs/aiohttp#4451 (comment) |
Would love to @bdraco |
#789 is available in 20.0.0 |
When performing mdns or dns resolution for a given hostname v4
addresses are always returned for the connection over v6 when an address
supports dual stacks.
This allows for ipv6 transitioning and testing in a dual stack
environment. It also follows common practice when picking the right
address to try first.
Not addressed by this commit is the ability to fall back to other
resolved addresses should the first address fail. This feature is
addressed by other todo's in the project.