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

Listen on all addresses #56

Closed
rbmj opened this issue Oct 25, 2016 · 4 comments
Closed

Listen on all addresses #56

rbmj opened this issue Oct 25, 2016 · 4 comments
Labels

Comments

@rbmj
Copy link

rbmj commented Oct 25, 2016

Currently, named doesn't actually listen on all specified addresses. It takes the first address (both v4 and v6), or a default of 0.0.0.0 and ::0. In addition, there's no way to disable IPv4 or IPv6 as even if an IPv4 address is specified the system still will use the default IPv6 address - even if no IPv6 address is set or even if it is explicitly set to the empty list.

This breaks some dual-stack systems as well where IPV6_V6ONLY is by default false, because the v6 socket cannot bind as it conflicts with the v4 socket.

The attached patch is my attempt to fix the issue - I haven't tested every edge case, but it works on my system (debian) with the default configuration (example.toml) under simple tests, and seems sane to me.
0001-Listen-on-all-available-IP-addresses.txt

@bluejekyll bluejekyll added the bug label Oct 25, 2016
@bluejekyll
Copy link
Member

Thanks for submitting this. I'll try and apply the patch you submitted and put up a PR as soon as I can. This might not be for a few days though.

@rbmj
Copy link
Author

rbmj commented Oct 26, 2016

That sounds fine - next time I'll be less lazy and get github to do a proper fork for me.

bluejekyll added a commit that referenced this issue Oct 29, 2016
@bluejekyll
Copy link
Member

bluejekyll commented Oct 29, 2016

See the commit I just pushed. That incorporates your fix (mostly verbatum, though I made it fail a little nicer).

I wrote a new test harness for the named bin, which I had been planning on doing for a while, this gave me a good reason to. Anyway, you can run these tests with cargo test or more specifically cargo test --test z_named_test to test just ipv4 listeners, and both ipv4 and ipv6. I found at least on my mac that an ipv6 only listener is still routable from ipv4 via the standard ipv4 address mapping to ipv6, not sure if that is true on other OS'

edit: travis still has a bad ipv6 config, so I had to ignore the ipv6 test, you can test that with cargo test --test z_named_test -- --ignored

bluejekyll added a commit that referenced this issue Oct 29, 2016
@bluejekyll
Copy link
Member

I believe that the patch I submitted fixes this. If not please reopen.

japaric added a commit to ferrous-systems/hickory-dns that referenced this issue May 29, 2024
…ling

resolver: add CD bit handling tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants