Bug 719178 - Applications can't connect to IPv6 link-local addresses learned through nss-mdns and Avahi
Summary: Applications can't connect to IPv6 link-local addresses learned through nss-m...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: nss-mdns
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 843054
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-06 00:46 UTC by Pavel Šimerda (pavlix)
Modified: 2016-12-20 12:08 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-20 12:08:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Pavel Šimerda (pavlix) 2011-07-06 00:46:56 UTC
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 12:26:11 UTC
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 20:10:05 UTC
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 06:42:16 UTC
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 21:55:04 UTC
Thanks for confirming my idea.

Comment 6 Pavel Šimerda (pavlix) 2012-05-28 00:16:38 UTC
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 22:28:59 UTC
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 23:56:15 UTC
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 15:15:17 UTC
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-07 02:40:09 UTC
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

Comment 11 Charles-Henri d'Adhémar 2016-10-12 19:36:55 UTC
I have a fix (or workaround ?).
I replaced mdns4 with mdns in /etc/nsswitch.conf and avahi is working great with ipv4 and ipv6 :

/etc/nsswitch.conf:
...
#hosts:      files mdns4_minimal [NOTFOUND=return] dns myhostname
hosts:      files mdns_minimal [NOTFOUND=return] dns myhostname
...

Comment 12 Charles-Henri d'Adhémar 2016-10-12 19:41:20 UTC
Sorry I forgot to tell that the bug is reproducible on F24 and the fix worked on F24 (not tested on F23).

Comment 13 Pavel Šimerda (pavlix) 2016-10-13 09:10:35 UTC
I'm afraid this bug is about a problem in both nss-mdns and glibc including the glibc name service switch API which is apparently insufficient. It is one of the glibc limitations I have covered in my netresolve project that, among other things, provides a showcase resolver that overcomes those limitations by using a different API.

Therefore, if you think you actually have a fix, please provide the details of your testing method and prove me wrong. Please also note that I've been using /etc/nsswitch.conf without the `4` as long as I remember.

Comment 14 Fedora End Of Life 2016-11-24 10:32:40 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. 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 EOL if it remains open with a Fedora  'version'
of '23'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 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 this bug is closed as described in the policy above.

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 15 Fedora End Of Life 2016-12-20 12:08:05 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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