Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 2002 00:10:19 -0700
From:      Peter Haight <peterh@sapros.com>
To:        Mike Makonnen <makonnen@pacbell.net>
Cc:        hackers@freebsd.org
Subject:   Re: gethostbyname2 and AF_INET6 
Message-ID:  <200205130710.g4D7AJUn049722@wartch.sapros.com>

next in thread | raw e-mail | index | archive | help
>In mozilla's case, it's not the FreeBSD resolver that's trying ipv6 and
>then ipv4. Mozilla does it explicitly by calling gethostbyname2 first
>with AF_INET6, and if that fails with AF_INET. You could just patch it
>to not make the first gethostbyname2 call. From a quick browse of the
>source from  mozilla.org it's src/misc/prnetdb.c around line # 579 or
>thereabouts.

Yeah. That's exactly what I did to make it work nicely on my machine, but
that's not a real solution as it breaks IPv6 resolving. 

I'm going to try Terry's solution and try and do concurrent lookups. Mozilla
is already using pthreads, so I should be able to just spawn the two
requests in separate threads and take the one that comes back first. I may
even spawn the IPv6 one a little earlier to give it a slightly better chance
of coming back first.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205130710.g4D7AJUn049722>