[Bug network/14413] New: nsswitch doesn't implement getaddrinfo(), plugins cannot supply link-local IPv6 addresses with scope id

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] New: nsswitch doesn't implement getaddrinfo(), plugins cannot supply link-local IPv6 addresses with scope id

glaubitz at physik dot fu-berlin.de
http://sourceware.org/bugzilla/show_bug.cgi?id=14413

             Bug #: 14413
           Summary: nsswitch doesn't implement getaddrinfo(), plugins
                    cannot supply link-local IPv6 addresses with scope id
           Product: glibc
           Version: 2.17
            Status: NEW
          Severity: normal
          Priority: P2
         Component: network
        AssignedTo: [hidden email]
        ReportedBy: [hidden email]
    Classification: Unclassified


GLIBC's name service switch doesn't provide a way to override getaddressinfo()
which is the only function that supports IPv6 link-local addresses.

IPv6 link-local addresses don't work without the interface name (when
written as text) that then translates to scope id.

http://tools.ietf.org/html/rfc2553

glibc-2.15-37.fc17.x86_64

--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot supply link-local IPv6 addresses with scope id

glaubitz at physik dot fu-berlin.de
http://sourceware.org/bugzilla/show_bug.cgi?id=14413

--- Comment #1 from Pavel Šimerda <psimerda at redhat dot com> 2012-07-27 15:15:46 UTC ---
Fedora bug:

https://bugzilla.redhat.com/show_bug.cgi?id=843054

This is actually needed for link-local name resolution (whatever NSS plugin is
used for it then).

--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
http://sourceware.org/bugzilla/show_bug.cgi?id=14413

Pavel Šimerda <psimerda at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|nsswitch doesn't implement  |nsswitch doesn't implement
                   |getaddrinfo(), plugins      |getaddrinfo(), plugins
                   |cannot supply link-local    |cannot provide full
                   |IPv6 addresses with scope   |getaddrinfo features
                   |id                          |

--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
http://sourceware.org/bugzilla/show_bug.cgi?id=14413

--- Comment #2 from Pavel Šimerda <psimerda at redhat dot com> 2012-07-31 13:31:37 UTC ---
There's another usecase for getaddrinfo() in nsswitch and that is avoiding
problems caused by solutions to bug 12377 including bug 12398. See discussions
in these two bug reports.

--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
http://sourceware.org/bugzilla/show_bug.cgi?id=14413

Tore Anderson <tore at fud dot no> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tore at fud dot no

--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

Alexandre Oliva <aoliva at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aoliva at sourceware dot org

--- Comment #3 from Alexandre Oliva <aoliva at sourceware dot org> ---
Hi, Pavel,

I assume you're speaking of such addresses as ipv6%zone, as specified in RFC
4007.  That RFC only specifies (hex) numeric addresses in standard ipv6 format,
folowed by a % and a zone id, that may be numeric, an interface name, or
somesuch.

Since the address can only be numeric, without involving any lookups, and that
and zone ids specified in that RFC are supported by existing getaddrinfo core
implementation, what would the point be of introducing a getaddrinfo interface
in the nss plugin interface?

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

--- Comment #4 from Pavel Šimerda <psimerda at redhat dot com> ---
Hi Alexandre,

1) scope_id

There are name services that are capable of returning IPv6 link local addresses
such as Multicast DNS. Those IPv6 link local addresses don't work as expected,
though, as they miss the scope_id.

2) AI_ADDRCONFIG

There are name resolution protocols that should avoid querying for IPv4/IPv6
data according to the system configuration when AI_ADDRCONFIG is set. On the
other hand, for literal address translations, Multicast DNS and /etc/hosts,
this is counter-productive, see the linked bug reports.

3) __nss_gethostbyname*

The gethostbyname4 features are not superset of gethostbyname3 features which
means the API is not satisfactory whichever of them is used.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

Pavel Šimerda <psimerda at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |16826

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

Kevin Cox <kevincox at kevincox dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kevincox at kevincox dot ca

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
         Depends on|                            |19565


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=19565
[Bug 19565] Consolidate NSS name resolution interfaces
--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

Mantas <grawity at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |grawity at gmail dot com

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

github at kalvdans dot no-ip.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |github at kalvdans dot no-ip.org

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

Henrique <hdante at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hdante at gmail dot com

--- Comment #5 from Henrique <hdante at gmail dot com> ---
Hello, I can confirm that this bug is still present. IPv6 link local addresses
(fe80::/64) only work when coupled with sockaddr_in6.sin6_scope_id (some
interface number). Since gethostent only returns the address (through
hostent.h_addr_list), then all IPv6 link local addresses are returned in an
incomplete way and so are broken.

This is why mdns does not work in linux with link local addresses.

Comparing with MacOS, getaddrinfo() seems to be implemented by the nss plugin,
so executing ssh -6 host.local works. In linux, executing ssh -6 host.local
does not work.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=19591

--- Comment #6 from Florian Weimer <fweimer at redhat dot com> ---
We need to redesign the NSS interface anyway, but I'd prefer if we had the NSS
modules allocate the required memory, after bug 19591 is fixed.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |2099


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=2099
[Bug 2099] Support for SRV records in getaddrinfo
--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

Craig McQueen <pub at craig dot mcqueen.id.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pub at craig dot mcqueen.id.au

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

--- Comment #7 from Florian Weimer <fweimer at redhat dot com> ---
Fixing bug 19591 is not necessary if we add a function to the NSS module which
frees the allocated data structures.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug network/14413] nsswitch doesn't implement getaddrinfo(), plugins cannot provide full getaddrinfo features

Sourceware - glibc-bugs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=14413

Gavin <gavin at matician dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gavin at matician dot com

--- Comment #8 from Gavin <gavin at matician dot com> ---
Confirming that this issue still exists as of 2.31.

ssh -v host.local works:

OpenSSH_8.2p1, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /home/gavin/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to host.local [fe80::88aa:55ff:fec5:dd9%wlan0] port 22.
debug1: Connection established.

ssh -v -6 host.local does not work:

OpenSSH_8.2p1, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /home/gavin/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to host.local [fe80::88aa:55ff:fec5:dd9] port 22.
debug1: connect to address fe80::88aa:55ff:fec5:dd9 port 22: Invalid argument

The first case calls get getaddrinfo() with hints->ai_family=AF_UNSPEC, the
second case calls it with hints->ai_family=AF_INET6.

As a workaround until gethostbyname5 comes along, would it make sense to modify
gethostbyname3 such that it stuffs a whole sockaddr_in6 into h_addr, sets
h_length to sizeof(sockaddr_in6), and glibc can take care of it accordingly
depending on the value of h_length?

--
You are receiving this mail because:
You are on the CC list for the bug.