Re: Make DNS requests follow the CURLOPT_INTERFACE if c-ares is in use
Date: Sat, 07 Sep 2013 13:51:50 -0400
On 2013-07-22 12:26 , Kim Vandry wrote:
> On 2013-07-18 15:14 , Daniel Stenberg wrote:
>> On Thu, 18 Jul 2013, Daniel Stenberg wrote:
>>>>> * b9f0e44 curl: Add support for various DNS binding options.
>> It does a nasty include of "../lib/inet_pton.h" which is incorrect in
>> several ways. curl cannot include libcurl internal headers with a direct
>> path like that and it shouldn't include libcurl private headers at all
>> (if it isn't a curlx* function). I see this code uses Curl_inet_pton()
>> which is an internal libcurl function that shouldn't be used like this
>> from curl even though I see you've added the source file to the curl
>> build. It should be made into a curlx_ version if that should remain so.
> Thanks for the explanation. If the change below if made, I think this
> use of inet_pton in the curl tool may no longer be necessary.
>> I do however think that you should make CURLOPT_DNS_LOCAL_IP* accept a
>> string of the IP address and do the conversion to binary within libcurl
>> and not in the application. Seems more in line with similar other
>> libcurl options too.
> I actually agree with this, and mentioned already that I wasn't fully
> comfortable with the current interface. Once again, the reason is that
> it is a thin layer over the existing c-ares interface.
> I will change it as you suggest.
I have addressed both of these issues by making the new options take
strings instead of binary IP addresses.
Please find two patches at https://github.com/vandry/curl , one for
libcurl and one for the command line tool.
Author: Ben Greear <greearb_at_candelatech.com>
Date: Sat Feb 9 13:18:02 2013 -0800
curl: Add support for various DNS binding options.
(Passed on to c-ares.)
Allows something like this:
curl --dns-interface sta8 --dns-ipv4-addr 220.127.116.11 --interface
sta8 --localaddr 18.104.22.168 --dns-servers 22.214.171.124 www.google.com
Signed-off-by: Ben Greear <greearb_at_candelatech.com>
Author: Kim Vandry <vandry_at_TZoNE.ORG>
Date: Sat Sep 7 12:45:50 2013 -0400
libcurl: New options to bind DNS to local interfaces or IP addresses
List admin: http://cool.haxx.se/list/listinfo/curl-library
Received on 2013-09-07