This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 4/4] resolv: fix rotate option
- From: Andreas Schwab <schwab at suse dot de>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: Aurelien Jarno <aurelien at aurel32 dot net>, libc-alpha at sourceware dot org
- Date: Wed, 18 Feb 2015 17:54:03 +0100
- Subject: Re: [PATCH 4/4] resolv: fix rotate option
- Authentication-results: sourceware.org; auth=none
- References: <1402673533-13243-1-git-send-email-aurelien at aurel32 dot net> <1402673533-13243-5-git-send-email-aurelien at aurel32 dot net> <20140620030456 dot GW7238 at spoyarek dot pnq dot redhat dot com>
Siddhesh Poyarekar <siddhesh@redhat.com> writes:
> On Fri, Jun 13, 2014 at 05:32:13PM +0200, Aurelien Jarno wrote:
>> The rotate option doesn't work correctly, and only send the query to the
>> same server (the second in the list). The rotation code in itself is not
>> broken, but the nsaddrs structure is reinitialized each time at the
>> beginning of __libc_res_nsend unless RES_STAYOPEN is enabled.
>>
>> This is due to a call to __res_iclose from the end of __libc_res_nsend
>> when answers from the name server have been received. This function
>> closes all the sockets, but doesn't free the addresses (it can do that,
>> but in that case the second argument is false).
>>
>> This patch change the code of __res_iclose to clear
>> statp->_u._ext.nsinit only when the addresses are actually freed.
>>
>> 2014-06-13 Aurelien Jarno <aurelien@aurel32.net>
>>
>> * resolv/res_init.c (__res_iclose): Only clear nsinit if the
>> addresses have been freed.
>
> Looks good to me
This is broken. It means that __libc_res_nsend no longer reinitializes
its cached copy of the name servers.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."