[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(usagi-users 02054) Re: getifaddrs() in glibc, IPv6 detection questions
- To: usagi-users@xxxxxxxxxxxxxx
- Subject: (usagi-users 02054) Re: getifaddrs() in glibc, IPv6 detection questions
- From: David Helder <dhelder@xxxxxxxxx>
- Date: Mon, 6 Jan 2003 16:32:18 -0500 (EST)
- In-reply-to: <20021101.094656.32255368.yoshfuji@linux-ipv6.org>
- Reply-to: usagi-users@xxxxxxxxxxxxxx
On Fri, 1 Nov 2002, YOSHIFUJI Hideaki / [iso-2022-jp] 吉藤英明 wrote:
> In article <Pine.LNX.4.40.0210311612020.7725-100000@xxxxxxxxxxxxxxxxxxxx> (at Thu, 31 Oct 2002 16:25:09 -0500 (EST)), David Helder <dhelder@xxxxxxxxx> says:
> > [Detecting IPv6]
> > The best solution I've come up with is to get the list of interfaces,
> > check if there's an interface that supports IPv6, and only return an IPv6
> > address if there is an IPv6 supporting interface. Is this sensible or is
> > there a better solution?
>
> 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).
David
--
__ _ __ David Helder - dhelder@xxxxxxxxx
___/ /__ __ __(_)__/ / <http://www.eecs.umich.edu/~dhelder>
/ _ / _ `/ |/ / / _ / DiaWebLog: <http://www.diaweblog.org>
|_,_/|_,_/|___/_/|_,_/ Paper CD Case: <http://www.papercdcase.com>