8000 Minor Issue with Interface Index and IPv6 · Issue #1378 · python-zeroconf/python-zeroconf · GitHub
[go: up one dir, main page]

Skip to content

Minor Issue with Interface Index and IPv6 #1378

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

Open
schnitzlein opened this issue Jun 6, 2024 · 0 comments
Open

Minor Issue with Interface Index and IPv6 #1378

schnitzlein opened this issue Jun 6, 2024 · 0 comments

Comments

@schnitzlein
Copy link
schnitzlein commented Jun 6, 2024

Hi

I like your library and tool and use it quite some time.
I have found out that in some case there might be a minor issue.

I have (for reasons what ever) a IPv6 Link Logical Adress.

I checked the issue with different constraints, scraping for many time solves the issue.
But when scraping for short time period, all is fetched!
Everything is fine, except for the "interface_index" in Service Discovery info.

I think a simply fix might help here, I found out that the check is only for the length of the ip if it is 16 or not.
But It can be simply >= 16.

Please see here: https://github.com/python-zeroconf/python-zeroconf/blob/master/src/zeroconf/_services/info.py#L252

version is >= 3.9.0 see: sys.version_info(major=3, minor=10, micro=12, releaselevel='final', serial=0)

If this is >= 16 it should work for short scraping.

My Test Program shows it simply here:

`import ipaddress
ip6adr = str(ipaddress.IPv6Address(ip))
ip = "fe80::22b0:f7ff:fe07:2178"
ip6adr = str(ipaddress.IPv6Address(ip))
if ipaddress.ip_address(ip6adr).is_link_local:
print("Interface number is required!")

print(len(ip))
`

This shows that it can be a Link Logical Address with a length greater than 16.
I have to scrape very long time to be luckily and get the interface_index or often it is not present.

But in my scenario, I simply scrape 3 times not more, because of time constraints.
May I missed one option?
Force interface_index to be present oder something?

greetings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0