Red Hat Bugzilla – Bug 843051
getaddrinfo() fails to parse IPv6 addresses on hosts without global IPv6
Last modified: 2016-11-24 10:56:49 EST
I've just stumbled upon a nasty bug in the getaddrinfo function that most problably started as a workaround for misconfigured IPv6 hosts. Unfortunately
it affects more than just DNS resolution, it also affects literal IPv6 addresses.
IPv6's core feature is support for link-local addresses (fe80::/64) and a node-local address (::1) that work *without global connectivity*. IPv4 hosts also have a node-local address (127.0.0.1) and may occasionaly use link-local addresses (169.254.x.y).
These scoped addresses don't work on hosts without global IPv6 addresses.
How reproducible: always
Steps to Reproduce:
1. Disconnect from any IPv6 networks
2. Remove any global IPv6 addresses (ip -6 address flush scope global)
3. Make sure SSH server is turned on (you can use other services, too)
4. Connect: ssh ::1
5. Add a global address (ip a a 2001:db8::890 dev lo)
6. Connect again: ssh ::1
4: RTNETLINK answers: Cannot assign requested address
*** This bug has been marked as a duplicate of bug 808147 ***