[RESEND-2][PATCH][BZ #13760] Fix dns lookup for AF_UNSPEC when response for T_A exceeds buffer size

Andreas Jaeger aj@suse.com
Wed Mar 28 10:45:00 GMT 2012


On 03/28/2012 12:20 PM, Siddhesh Poyarekar wrote:
> On Wed, Mar 28, 2012 at 3:21 PM, Andreas Jaeger<aj@suse.com>  wrote:
>>> The current check looks for the ERANGE error in 'errno' when it should
>>> be looking for it in *errnop (where gaih_getanswer_slice sets
>>
>>
>> The single change for *errnop is ok.
>>
>>> it). Also, we should discard the second response and retry the query
>>> in case of NSS_STATUS_TRYAGAIN and ERANGE (buffer too small) only when
>>> the response error is recoverable. The only condition in which this
>>> currently occurs (buffer too small and h_errno is NO_RECOVERY) is when
>>> the hostname returned by the query is longer than MAXHOSTNAMELEN.
>>
>>
>> I don't see how this is addressed with your change. Is the patch incomplete
>> - or what do I miss?
>>
>
> Thanks for the review. The same line has two changes: using *errnop
> instead of errno and the changed condition, which addresses what I
> described above:
>
> *h_errnop != NO_RECOVERY
> to
> *h_errnop == NO_RECOVERY

Indeed, I missed that.

This code is rather confusing. Your analysis and fix looks fine. I 
suggest to add a short comment before the line you change to explain 
what is tested.

> I guess the missing bz entry in the ChangeLog is for the other patch?

Yes, it was.

Andreas
>
> 2012-02-22  Siddhesh Poyarekar<siddhesh@redhat.com>
>
> 	[BZ #13760]
> 	* resolv/nss_dns/dns-host.c (gaih_getanswer): Look for errno
> 	in the right place. Discard and retry query if response is
> 	larger than input buffer size.
>


-- 
  Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
   SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
    GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
     GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126



More information about the Libc-alpha mailing list