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:
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.
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 getaddrinfo( "craig- linux.local" , None) :21b:21ff: febb:73b2% eth2', 0, 0, 3)), :21b:21ff: febb:73b2% eth2', 0, 0, 3)), :21b:21ff: febb:73b2% eth2', 0, 0, 3)), getaddrinfo( "craig- linux.local" , None, socket.AF_INET6) :21b:21ff: febb:73b2' , 0, 0, 0)), :21b:21ff: febb:73b2' , 0, 0, 0)), :21b:21ff: febb:73b2' , 0, 0, 0))]
>>> from pprint import pprint
>>> a = socket.
>>> pprint(a)
[(10, 1, 6, '', ('fe80:
(10, 2, 17, '', ('fe80:
(10, 3, 0, '', ('fe80:
(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.
>>> pprint(a)
[(10, 1, 6, '', ('fe80:
(10, 2, 17, '', ('fe80:
(10, 3, 0, '', ('fe80:
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.