Archive Index This month's Index

Subject: Re: Binding to local IP and/or network device.

Re: Binding to local IP and/or network device.

From: Tommie Gannert <tommie_at_spotify.com>
Date: Thu, 20 May 2010 09:01:58 +0200

Ben Greear wrote:
> On 05/19/2010 03:34 AM, Daniel Stenberg wrote:
>> On Tue, 18 May 2010, Ben Greear wrote:
>>
>>> We do a lot of work on multi-homed machines, and I'd like to be able
>>> to specify the source IP address for outgoing DNS requests generated
>>> by libcurl logic.
>>>
>>> It appears that this will not be too hard to add to c-ares, probably
>>> in the configure_socket() method in ares_process.c
>>>
>>> Before I start making changes, I just want to make sure that no one is
>>> currently working on this.
>>
>> It should be fairly easy, yes, and I think it would be a welcomed
>> addition.
>>
>> In case of need, I'm sure you can find inspiration to the actual code
>> from the curl source code.
>
> I've yet to actually integrate and run this code, but does this
> look like a valid approach for c-ares?
Just a thought: In my glibc, I find the definitions

  extern const struct in6_addr in6addr_any; /* :: */
  #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }

and according to

  http://www.opengroup.org/onlinepubs/000095399/basedefs/netinet/in.h.html

they are in POSIX.

-- 
Tommie Gannert
Developer
Spotify
This e-mail (including any attachments) may contain information that is
confidential and/or privileged. It is intended only for the recipient(s).
If you have reason to believe that you are not the intended recipient of
this e-mail, please contact the sender immediately and delete the e-mail
from your computer.

Received on 2010-05-20