[Bug 369008] Re: mdns lookups fail over ipv6
Craig McQueen
369008 at bugs.launchpad.net
Tue Apr 8 03:08:15 UTC 2014
Okay I think I've found a problem with getaddrinfo() when the AF_INET6
family is specified. For example, Python's socket.getaddrinfo() provides
scope ID if _all_ families are looked-up, but it returns scope ID of 0
if only IPv6 family is looked up. E.g. in Python:
>>> import socket
>>> from pprint import pprint
>>> a = socket.getaddrinfo("craig-linux.local", None)
>>> pprint(a)
[(10, 1, 6, '', ('fe80::21b:21ff:febb:73b2%eth2', 0, 0, 3)),
(10, 2, 17, '', ('fe80::21b:21ff:febb:73b2%eth2', 0, 0, 3)),
(10, 3, 0, '', ('fe80::21b:21ff:febb:73b2%eth2', 0, 0, 3)),
(2, 1, 6, '', ('192.168.5.3', 0)),
(2, 2, 17, '', ('192.168.5.3', 0)),
(2, 3, 0, '', ('192.168.5.3', 0))]
>>> a = socket.getaddrinfo("craig-linux.local", None, socket.AF_INET6)
>>> pprint(a)
[(10, 1, 6, '', ('fe80::21b:21ff:febb:73b2', 0, 0, 0)),
(10, 2, 17, '', ('fe80::21b:21ff:febb:73b2', 0, 0, 0)),
(10, 3, 0, '', ('fe80::21b:21ff:febb:73b2', 0, 0, 0))]
So for some reason the scope ID is present when doing all-families look-
up, but lacking in the IPv6-only family look-up.
ping6 fails because it is specifying AF_INET6.
I've got a test server listening on both IPv4 and IPv6. If I connect to
it with "telnet craig-linux.local 12100" then it is able to connect
successfully to the IPv6 address. But if I specify the -6 switch,
"telnet -6 craig-linux.local 12100" then it fails to connect.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to nss-mdns in Ubuntu.
https://bugs.launchpad.net/bugs/369008
Title:
mdns lookups fail over ipv6
Status in “nss-mdns” package in Ubuntu:
Confirmed
Bug description:
Binary package hint: libnss-mdns
I have avahi running on a couple hosts (Jaunty) in my dual-stack lan.
All ipv4 mdns resolution seems to work fine, but ipv6 resolution seems
to be failing, even though resolving the same ipv6 hosts works fine
using bind. I'm not sure exactly where in the chain the fault lies,
but something seems to be amiss. Additionally, a Mac running Bonjour
has no problem resolving the same hosts using IPv6.
/etc/avahi/avahi-daemon.conf
[server]
#host-name=foo
#domain-name=local
#browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
use-ipv6=yes
#check-response-ttl=no
#use-iff-running=no
#enable-dbus=yes
#disallow-other-stacks=no
#allow-point-to-point=no
[wide-area]
enable-wide-area=yes
[publish]
#disable-publishing=no
#disable-user-service-publishing=no
#add-service-cookie=no
#publish-addresses=yes
#publish-hinfo=yes
#publish-workstation=yes
#publish-domain=yes
#publish-dns-servers=192.168.50.1, 192.168.50.2
#publish-resolv-conf-dns-servers=yes
#publish-aaaa-on-ipv4=yes
publish-a-on-ipv6=yes
[reflector]
#enable-reflector=no
#reflect-ipv=no
...
----------------
root at host1:/# ping host2
PING host2 (192.168.4.1) 56(84) bytes of data.
64 bytes from host2 (192.168.4.1): icmp_seq=1 ttl=64 time=0.243 ms
^C
--- host2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.243/0.243/0.243/0.000 ms
root at host1:/# ping host2.local
PING host2.local (192.168.4.1) 56(84) bytes of data.
64 bytes from host2 (192.168.4.1): icmp_seq=1 ttl=64 time=0.212 ms
^C
--- host2.local ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.212/0.212/0.212/0.000 ms
root at host1:/# ping6 host2
PING host2(2001:X:X:X::1) 56 data bytes
64 bytes from 2001:X:X:X::1: icmp_seq=1 ttl=64 time=0.189 ms
^C
--- host2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.189/0.189/0.189/0.000 ms
root at host1:/# ping6 host2.local
unknown host
----------------
The kicker is, the Mac has no problem with this last lookup, meaning
the issue has to be with my linux client implementation:
macbookpro:~$ ping6 host2.local
PING6(56=40+8+8 bytes) 2001:X:X:X:X:X:X:X --> 2001:X:X:X::1
16 bytes from 2001:X:X:X::1, icmp_seq=0 hlim=64 time=98.522 ms
16 bytes from 2001:X:X:X::1, icmp_seq=1 hlim=64 time=2.524 ms
^C
--- host2.local ping6 statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 2.524/50.523/98.522 ms
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nss-mdns/+bug/369008/+subscriptions
More information about the foundations-bugs
mailing list