Skip to content
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

engine: net.ParseIP does not understand IPv6 scope ID #2036

Open
bassosimone opened this issue Feb 22, 2022 · 0 comments
Open

engine: net.ParseIP does not understand IPv6 scope ID #2036

bassosimone opened this issue Feb 22, 2022 · 0 comments
Labels
bug Something isn't working correctly ooni/probe-engine priority/low Nice to have

Comments

@bassosimone
Copy link
Contributor

bassosimone commented Feb 22, 2022

Code inside the engine uses net.ParseIP to parse resolved IP addresses. Go stdlib resolver (and ooni/probe-cli#698) consider the IPv6 scope ID when serializing IP addresses. And net.ParseIP does not handle the scope. Therefore, if a DNS resolution returns a scoped IP address, we fail to parse it. In the specific context of ooni/probe-cli#698, the symptom was that sessionresolver failed with dns_bogon_error because it could not parse the returned IPv6 addresses and thus concluded it was passed a bogon (this is an unfortunate issue of the design of the code for detecting bogons). After noticing that, I changed the code to not include the scope ID if it is zero. But there is still a ticking bomb that basically most of the engine is not prepared to serialized scoped IPv6 addresses (so, e.g., a DHCP server may give out scoped IPv6 addresses representing the default resolver). I think in most cases this will not be a problem, but we know that IPv6 uses the scope for link-local addresses. We'll consider this issue done when we'll have figured out a better and scope-aware way of parsing IP addresses and we'll have removed net.ParseIP from our code base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly ooni/probe-engine priority/low Nice to have
Projects
None yet
Development

No branches or pull requests

2 participants