From owner-freebsd-hackers Mon May 13 0:12:21 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from wartch.sapros.com (rularan.sapros.com [204.182.55.17]) by hub.freebsd.org (Postfix) with ESMTP id BD5B337B421 for ; Mon, 13 May 2002 00:10:32 -0700 (PDT) Received: from wartch.sapros.com (localhost [127.0.0.1]) by wartch.sapros.com (8.12.3/8.12.3) with ESMTP id g4D7AJUn049722; Mon, 13 May 2002 00:10:19 -0700 (PDT) (envelope-from peterh@wartch.sapros.com) Message-Id: <200205130710.g4D7AJUn049722@wartch.sapros.com> To: Mike Makonnen Cc: hackers@freebsd.org Subject: Re: gethostbyname2 and AF_INET6 Date: Mon, 13 May 2002 00:10:19 -0700 From: Peter Haight X-Spam-Status: No, hits=1.8 required=7.0 tests=NO_MX_FOR_FROM version=2.11 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >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