Bug 719178 - Applications can't connect to IPv6 link-local addresses learned through nss-mdns and Avahi
Applications can't connect to IPv6 link-local addresses learned through nss-m...
Status: NEW
Product: Fedora
Classification: Fedora
Component: nss-mdns (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lennart Poettering
Fedora Extras Quality Assurance
:
Depends On: 843054
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-05 20:46 EDT by Pavel Šimerda (pavlix)
Modified: 2015-11-28 15:18 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Pavel Šimerda (pavlix) 2011-07-05 20:46:56 EDT
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.

Reproducible: Always

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
  
Actual results:

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.

Expected results:

3. Successful SSH connection.
4. Successful ping.
5. Successful HTTP request.

Rationale:

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.

Additional info:

* 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.
Comment 1 Fedora Admin XMLRPC Client 2011-11-30 07:26:11 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 2 Pavel Šimerda (pavlix) 2012-03-31 16:10:05 EDT
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.
Comment 3 Tomas Mraz 2012-04-02 02:42:16 EDT
I agree this is problem of nss-mdns - it probably fails to properly fill-in the sin6_scope_id in the getaddrinfo call.
Comment 4 Pavel Šimerda (pavlix) 2012-04-02 17:55:04 EDT
Thanks for confirming my idea.
Comment 6 Pavel Šimerda (pavlix) 2012-05-27 20:16:38 EDT
BSD patch here:

http://ensiwiki.ensimag.fr/images/9/98/Patch-src_AAA-nss-mdns-linklocal.c

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.
Comment 7 Pavel Šimerda (pavlix) 2012-07-31 18:28:59 EDT
GLIBC bugreport:

http://sourceware.org/bugzilla/show_bug.cgi?id=14413

Without this, nss-mdns can't work with link-local IPv6 addresses.
Comment 8 Fedora End Of Life 2013-07-03 19:56:15 EDT
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.
Comment 9 Jan Kurik 2015-07-15 11:15:17 EDT
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:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23
Comment 10 markzzzsmith 2015-11-06 21:40:09 EST
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"
https://tools.ietf.org/html/draft-smith-ipv6-link-locals-apps-00

Note You need to log in before you can comment on or make changes to this bug.