Subject: Re: [PATCH] Use libresolv to initialize cares on iPhone targets

Re: [PATCH] Use libresolv to initialize cares on iPhone targets

From: David Drysdale <drysdale_at_google.com>
Date: Fri, 15 Jan 2016 15:30:24 +0000

On Sat, Jan 9, 2016 at 7:44 PM, Gregor Jasny <gjasny_at_googlemail.com> wrote:
> Hello,
>
> On 25/11/15 15:24, Gregor Jasny wrote:
>> this is a reworked version of Yury Kirpichev's patch to add iOS support
>> to cares. Compared to the former version the following has been added:
>>
>> * IPv6 name server now work properly. The ones ones in nsaddr_list have
>> their address family set to AF_UNSPEC. As a work-around we call
>> res_getservers instead.
>>
>> * More options like search domains, ndots, etc. are applied
>>
>> * Added autoconf magic to detect iPhone (iOS, tvOS, and watchOS)
>> presence and use libresolv there.
>>
>> In theory we could use the libresolv code also on OSX. But to avoid
>> possible regressions I decided against it for a start.
>>
>> Patch is attached and also in this PR:
>> https://github.com/bagder/c-ares/pull/29
>
> Would you please consider reviewing and applying this patch? It is a
> really low risk change for existing platforms because it mostly adds
> code within the CARES_USE_LIBRESOLV define.
>
> Functionality also has been tested successfully with any combination of
> IPv4 and IPv6 name servers.
>
> Thanks,
> Gregor

Hi Gregor,

The patch looks good to me, except one minor thing -- I think it needs a
check for failure of the strdup() calls.

(Note: I've successfully built iPhone binaries with the patch applied, but I
haven't run them.)

Thanks,
David
Received on 2016-01-15