[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [msmtp-users] PATCH: bind to source IP



On Fri, 20 Feb 2015 14:12:51 +0000 (UTC), G H wrote:
> Patch is attached to cause msmtp to bind to a source IP address
> before connecting to the remote endpoint. This is useful for
> source-based routing. Note that DNS lookups will still be going out
> your default interface; use a local dnsmasq or IPtables SNATing to
> fix this. 

I must admit I'm not familiar with the use case of source-based
routing. I once read that one should use SO_BINDTODEVICE if the packets
should go out a specific network interface; is this what you want to
do? If not, could you explain how binding to an IP address is useful;
if yes, could you explain the relation of your patch to SO_BINDTODEVICE?
For example, this article seems to hint at problems:
http://codingrelic.geekhold.com/2009/10/code-snippet-sobindtodevice.html

Regards,
Martin