-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Ignore unspecified addresses from zeroconf #81620
Conversation
Some devices include 0.0.0.0 in their addresses. We need to ignore these addresses as they are invalid see issue home-assistant#81590 (A seperate fix for homekit_controller will come in another PR)
@@ -552,12 +552,20 @@ def _first_non_link_local_address( | |||
"""Return the first ipv6 or non-link local ipv4 address, preferring IPv4.""" | |||
for address in addresses: | |||
ip_addr = ip_address(address) | |||
if not ip_addr.is_link_local and ip_addr.version == 4: | |||
if ( | |||
not ip_addr.is_link_local |
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.
Why are we ignoring link-local addresses? That's a valid IP address in the context of discovering stuff in the LAN.
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.
This code only orders the ip addresses to present the one we can most likely connect to first. All of them are still accessible as addresses
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.
OK. First non link local address. Understood.
@@ -552,12 +552,20 @@ def _first_non_link_local_address( | |||
"""Return the first ipv6 or non-link local ipv4 address, preferring IPv4.""" | |||
for address in addresses: | |||
ip_addr = ip_address(address) | |||
if not ip_addr.is_link_local and ip_addr.version == 4: | |||
if ( | |||
not ip_addr.is_link_local |
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.
OK. First non link local address. Understood.
Thanks |
Proposed change
Some devices include 0.0.0.0 in their addresses. We need to ignore these addresses as they are invalid
see issue #81590 (A seperate fix for homekit_controller is in #81621)
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: