Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Apr 2012 11:21:26 +1200
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        Hajimu UMEMOTO <ume@freebsd.org>
Cc:        freebsd-net@freebsd.org, Rainer Bredehorn <Bredehorn@gmx.de>
Subject:   Re: getifaddrs & ipv6 scope
Message-ID:  <CAFAOGNSu_03_DxNtnaTyb6_E0e1MHnmRuO2YoD2MU%2BAS0APnrQ@mail.gmail.com>
In-Reply-To: <yged37becg7.wl%ume@mahoroba.org>
References:  <20120413064142.10640@gmx.net> <CAFAOGNRLcadCMCZ8WjaFi3XYhzV55Tp0v=%2BoMGyLOv666bFHkA@mail.gmail.com> <yged37becg7.wl%ume@mahoroba.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 14 April 2012 06:03, Hajimu UMEMOTO <ume@freebsd.org> wrote:
> Hi,
>
>>>>>> On Fri, 13 Apr 2012 20:01:39 +1200
>>>>>> Andrew Thompson <thompsa@FreeBSD.org> said:
>
> thompsa> On 13 April 2012 18:41, Rainer Bredehorn <Bredehorn@gmx.de> wrot=
e:
>> 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 (a=
s 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. =A0However, it may break the
> applications which expect that getifaddrs() returns a link-local
> address with KAME's embeded scopeid representation. =A0I'm not sure
> there are such applications, for now.

This is now working how I expected it. From my original test app,

dev: bge0     address: <fe80::a6ba:dbff:fe03:d69%bge0> scope 2
dev: lo0      address: <::1> scope 0
dev: lo0      address: <fe80::1%lo0> scope 5
dev: tun5     address: <fe80::a6ba:dbff:fe03:d69%tun5> scope 6
dev: tun3     address: <fe80::a6ba:dbff:fe03:d69%tun3> scope 7
dev: tun0     address: <fe80::a6ba:dbff:fe03:d69%tun0> scope 8


regards,
Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFAOGNSu_03_DxNtnaTyb6_E0e1MHnmRuO2YoD2MU%2BAS0APnrQ>