Red Hat Bugzilla – Bug 719178
Applications can't connect to IPv6 link-local addresses learned through nss-mdns and Avahi
Last modified: 2015-11-28 15:18:17 EST
OpenSSH refuses to connect to mDNS names pointing to IPv6 link-local addresses. The same applies to ping6 for pinging. I'm not really sure where the problem is, but OpenSSH is the most important usecase.
Steps to Reproduce:
1. Connect two IPv6-enabled linux computers (better with no router)
2. Setup Avahi, so that it works on IPv4 and IPv6
2. Setup /etc/nsswitch.conf so that it uses mDNS for IPv4 and IPv6
3. Try to connect with ssh -6
4. Try to ping with ping6
5. Try curl -6
3. $ ssh -6 training.local
ssh: connect to host training.local port 22: Invalid argument
4. $ ping6 training.local
connect: Invalid argument
5. $ curl -6 http://training.local/
curl: (7) Failed to connect to fe80::e2cb:4eff:fe2e:2fa7: Invalid argument
That means ssh and ping6 are most probably trying to connect without interface information.
3. Successful SSH connection.
4. Successful ping.
5. Successful HTTP request.
1. Avahi knows the interface it gets mDNS info from.
2. IPv6 address structure can contain interface info.
3. Client applications can (and should!) use the information to provide
services announced by mDNS/DNS-SD.
* If the computers get IPv6 global addresses, mDNS advertises them instead link-local ones and everything works. The same applies for global/private IPv4.
* If you resolv manually and append interface info (%eth0, %wlan0, etc) to the link-local IP address, everything works.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
Are you sure this bug is about OpenSSH? It could just as well be nss-mdns unless other applications work. I see no comment why this was reassigned to OpenSSH.
I agree this is problem of nss-mdns - it probably fails to properly fill-in the sin6_scope_id in the getaddrinfo call.
Thanks for confirming my idea.
Some potentially useful links but mostly related to BSD:
BSD patch here:
Unfortunately I can't tell if a similar technique can be used for Linux Glibc or not. I don't know if it is possible to pass scope id from gethostbyname nor if NSS supports getaddrinfo.
Without this, nss-mdns can't work with link-local IPv6 addresses.
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '17'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 17's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 17 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged change the
'version' to a later Fedora version prior to Fedora 17's end of life.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.
(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)
More information and reason for this action is here:
I've been interested for a while in applications using Link-Locals, and in part because if this avahi/mdns-nss limitation, and the lack of coverage of the topic in Unix Network Programming v1 3rd Edition, wrote up the following Internet Draft recently. Comments and suggestions for improvement welcome.
"How to use IPv6 Link-Local Addresses in Applications"