This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] [BZ 14505] Avoid unwanted A lookups on IPV6 only host


On 08/21/2012 04:06 PM, Roland McGrath wrote:
Seems simpler to test "&& req->ai_family == PF_UNSPEC".
Also, you shouldn't call __nss_lookup_function at all when
you're not going to use its result.  So make it:

	      nss_gethostbyname4_r fct4 = NULL;
	      /* comment */
	      if (req->ai_family == PF_UNSPEC)
	        fct4 = __nss_lookup_function (nip, "gethostbyname4_r");
	      if (fct4 != NULL)
Thanks. I went back and forth between testing PF_UNSPEC and testing for PF_INET/PF_INET6 and selected the latter because I thought it was marginally clearer. It's certainly not a big deal to me. Testing PF_UNSPEC is slight more efficient from a code generation standpoint.

Totally agreed on avoiding the nss_lookup_function call.

Updated patch & ChangeLog entry attached.



Attachment: glibc-rh844921.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]