getifaddrs & ipv6 scope

Hajimu UMEMOTO ume at FreeBSD.org
Fri Apr 13 18:03:52 UTC 2012


Hi,

>>>>> On Fri, 13 Apr 2012 20:01:39 +1200
>>>>> Andrew Thompson <thompsa at FreeBSD.org> said:

thompsa> On 13 April 2012 18:41, Rainer Bredehorn <Bredehorn at gmx.de> wrote:
> Hi!
>
>> I have noticed that getifaddrs() does not have sin6_scope_id set to
>> the interface id for link local addresses on AF_INET6 types. Running
>> the following program gives different results on Linux
>
> ifconfig shows the scopeid according to the interface:
>
> inet6 fe80::208:9bff:fe13:784e%fxp1 prefixlen 64 scopeid 0x2
>
> Are you talking about the scope value of an multicast address or
> the scopeid for link local addresses?

thompsa> I am talking about the scopeid for link local addresses which (as far
thompsa> as I understand) is the interface index.

The issue you mentioned comes from an implementation decision of the
KAME IPv6 stack.
The attached patch should address it.  However, it may break the
applications which expect that getifaddrs() returns a link-local
address with KAME's embeded scopeid representation.  I'm not sure
there are such applications, for now.

Sincerely,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getifaddrs.c-scopeid.diff
Type: text/x-patch
Size: 1268 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20120413/bd1e42b7/getifaddrs.c-scopeid.bin
-------------- next part --------------

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume at mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/


More information about the freebsd-net mailing list