From owner-cvs-all Thu Apr 20 17:38:16 2000 Delivered-To: cvs-all@freebsd.org Received: from fgwmail7.fujitsu.co.jp (fgwmail7.fujitsu.co.jp [192.51.44.37]) by hub.freebsd.org (Postfix) with ESMTP id 5CAD437B5A0; Thu, 20 Apr 2000 17:38:10 -0700 (PDT) (envelope-from shin@nd.net.fujitsu.co.jp) Received: from m2.gw.fujitsu.co.jp by fgwmail7.fujitsu.co.jp (8.9.3/3.7W-MX0002-Fujitsu Gateway) id JAA23518; Fri, 21 Apr 2000 09:38:30 +0900 (JST) (envelope-from shin@nd.net.fujitsu.co.jp) Received: from chisato.nd.net.fujitsu.co.jp by m2.gw.fujitsu.co.jp (8.9.3/3.7W-0003-Fujitsu Domain Master) id JAA05217; Fri, 21 Apr 2000 09:38:07 +0900 (JST) Received: from localhost (dhcp7173.nd.net.fujitsu.co.jp [10.18.7.173]) by chisato.nd.net.fujitsu.co.jp (8.8.5+2.7Wbeta5/3.3W8chisato-970826) with ESMTP id JAA02441; Fri, 21 Apr 2000 09:38:06 +0900 (JST) To: green@FreeBSD.org Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/net getaddrinfo.c name6.c In-Reply-To: References: <200004200331.UAA85800@freefall.freebsd.org> X-Mailer: Mew version 1.94 on Emacs 20.4 / Mule 4.0 (HANANOEN) X-Prom-Mew: Prom-Mew 1.93.4 (procmail reader for Mew) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20000421093912D.shin@nd.net.fujitsu.co.jp> Date: Fri, 21 Apr 2000 09:39:12 +0900 From: Yoshinobu Inoue X-Dispatcher: imput version 990905(IM130) Lines: 64 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > Log: > > Change getaddrinfo() resolve order > > from > > all AAAA trial, then all A trial > > to > > try AAAA and A for each trial Sorry to be late to fix this. (It still needs some improvements but I committed it because many people seems to have problem with this.) > I wanted to change this myself, but I didn't feel like getting involved > with the getaddrinfo() code too well (I like my sanity, and not the > getaddrinfo() code ;). However, I have done the work for the > gethostbyname() family. Would you like to review it? Diffs are small, > so included. I have one question about the patches. > -static struct hostent * > -gethostbyname_internal(const char *name, int type, int doinet6first) > +struct hostent * > +gethostbyname2(const char *name, int type) > { > struct hostent *hp = 0; > int nserv = 0; > - int dohost6first, dobind6first; > - > - if (doinet6first) > - dohost6first = dobind6first = 1; > - else > - dohost6first = dobind6first = 0; > > if (!service_done) > init_services(); > @@ -149,19 +145,9 @@ > case SERVICE_NONE: > return NULL; > case SERVICE_HOSTS: > - if (dohost6first) { > - dohost6first = 0; > - hp = _gethostbyhtname(name, AF_INET6); > - continue; > - } > hp = _gethostbyhtname(name, type); > break; > case SERVICE_BIND: > - if (dobind6first) { > - dobind6first = 0; > - hp = _gethostbydnsname(name, AF_INET6); > - continue; > - } > hp = _gethostbydnsname(name, type); > break; What "type" value is supposed in doinet6first case? I suppose that someone is calling gethostbyname_internal(name, AF_INET, 1) at somewhere, but the part of diff seems to be missing. Thanks, Yoshinobu Inoue To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message