[Noah Meyerhans]
> This doesn't sound like a bug in libc or in ping6. getaddrinfo() will
> return a scope ID if you've explicitly provided one in the hints you've
> provided. For example, notice the different behavior when running
> Joachim's test.c program with a scoped address as opposed to a
> non-scoped address (e.g. fe80::21f:3bff:fe26:abcd%eth0 vs
> fe80::21f:3bff:fe26:abcd). getaddrinfo() has no way of knowing that the
> input address is related in any way to a particular interface, so it
> isn't going to assume that it's a link-local scope (or any other scope)
> of address, and is going to leave sin6_scope_id undefined. If you
> specify a link ID, then it knows to treat the address as link-local.
I do not know IPv6 addressing or the glibc internals well enough to
form an opinion on this, but I do not understand your argument. ping6
and libc can know from the values in the IPv6 address if it is a
link-local address or not, and if it is a link-local address, it need
the scope. Why isn't that enough to implement handling of this issue
in ping6 and libc?
Using that information, ping6 can know that fe80::21f:3bff:fe26:abcd
is not going to work, while fe80::21f:3bff:fe26:abcd%eth0 have a fair
chance of working. Why can't getaddrinfo()?
> The fact that "ping6 $(getent hosts $(hostname)|awk '{print $1}')"
> breaks when libnss-myhostname is installed further suggests that
> it's doign something wrong.
Or perhaps libc is doing something wrong. I noticed on FreeBSD,
ifconfig returned addresses with the %if ending for link local
addresses, while on linux ifconfig do not. This seem like a bug or
misfeature on Linux to me, that the addresses shown by ifconfig can
not be pinged. Perhaps it is caused by some underlying problem in
libc, also affecting ping6?
--
Happy hacking
Petter Reinholdtsen
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]