[Pkg-utopia-maintainers] Bug#644912: ipv6 link-local doesn't work as lookup doesn't set scope id

Simon McVittie smcv at debian.org
Thu Apr 26 08:26:39 BST 2018


On Mon, 10 Oct 2011 at 19:04:41 +0200, Stefan Bühler wrote:
> libnss-mdns doesn't set the scope-id for link-local addresses, so something
> like
> 
>     $ ping6 example.local
> gives
>     connect: Invalid argument

This specific use-case (ping6) unfortunately still doesn't work, but I
don't think there's anything that nss-mdns can do to fix this. However,
programs that use AF_UNSPEC rather than AF_INET6 now work if a system is
reconfigured from the default mdns4_minimal to mdns_minimal. For example,
telnet now sees a scope ID as expected:

% grep hosts: /etc/nsswitch.conf
hosts:          files mymachines gw_name myhostname mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns
% telnet xxxx.local
Trying fe80::xxxx:xxxx:xxxx:xxxx%wlp4s0...
Trying xxx.xxx.xxx.xxx...
telnet: Unable to connect to remote host: Connection refused
% telnet yyyy.local 80
Trying fe80::yyyy:yyyy:yyyy:yyyy%wlp4s0...
Connected to yyyy.local.
Escape character is '^]'.

On Mon, 24 Aug 2015 at 14:28:38 +0800, Jens B. Jorgensen wrote:
> Incidentally even /with/ my patch ping6 doesn't work. This is because
> due to the innards of how libnss works only when _nss_X_gethostbyname4_r
> is called is it possible to return the scope id--the outputs of the
> _nss_X_gethostbyname2_r and _nss_X_gethostbyname_r do not include this
> data--_nss_X_gethostbyname2 returns data through a struct hostent as
> does _nss_X_gethostbyname_r and unfortunately libnss doesn't call
> _nss_X_gethostbyname4_r unless address family is UNSPEC.

I don't think nss-mdns can fix this.

Loïc Minier <lool at dooz.org> wrote:
> I could witness IPv6 addresses returned by "getent hosts foo.local" on
> various hosts on my network.  One of the arguments in the past was that
> IPv6 was uncommon on local networks but at least iOS 6.1, MacOS X 10.6.8
> and Windows 8 respond with IPv6 link-local addresses to .local mDNS
> queries.  However a couple of devices from my ISP (router and TV STB)
> and a HP C5190 printer didn't, which resulted in ~5 seconds timeouts
> when connecting to them which I hadn't with the IPv4-only setup.

These 5 second delays (when using an application that resolves AF_INET6
and AF_INET separately, rather than using AF_UNSPEC) are why we only use
mdns4_minimal and not mdns_minimal by default.

A better argument than "IPv6 is uncommon on local networks" is "IPv4 is
good enough for local networks". The problem with IPv4 is that globally
routable address space is running out, but local networks don't normally
use globally routable address space anyway, and the RFC1918 and RFC3927
address ranges are large enough for individual LANs.

    smcv



More information about the Pkg-utopia-maintainers mailing list