[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(usagi-users 02063) Re: getifaddrs() in glibc, IPv6 detection questions



On Mon, 6 Jan 2003, Jeroen Massar wrote:
> > > AI_ADDRCONFIG flag will help you when available.
> > > Otherwise, yes, scan addresses; or, try to socket(2).
> > > (In latter case, kernel may try to insmod ipv6.o)
> > 
> > Then is it possible that an IPv6 interface would not be included by
> > getifaddrs() because the ipv6.o module hasn't been loaded?
> > 
> > I'm wondering then if it's a more reliable IPv6 test to 
> > attempt to bind to
> > 0::0 or to call socket(AF_INET6).
> 
> Even then it doesn't say a thing wether the target is reachable
> or if it is even possible to get out of the local subnet.
> 
> Just use getaddrinfo() that should take care of all your tests.
> If getaddrinfo() returns you AF_INET6 then there should also
> be support for IPv6 in the kernel.

Uhh, there are many ways to "use getaddrinfo()".  Some of them return you 
AF_INET6 addresses even though kernel does not have IPv6 enabled; that's 
perfectly acceptable to me.

-- 
Pekka Savola                 "Tell me of difficulties surmounted,
Netcore Oy                   not those you stumble over and fall"
Systems. Networks. Security.  -- Robert Jordan: A Crown of Swords