src/net_socket.c: Bind outgoing TCP sockets to `BindToAddress'.
authorFlorian Forster <octo@verplant.org>
Wed, 27 May 2009 12:20:24 +0000 (14:20 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Wed, 27 May 2009 22:35:00 +0000 (00:35 +0200)
If a host has multiple addresses on an interface, the source address of the TCP
connection(s) was picked by the operating system while the UDP packets used a
bound socket, i. e. the source address was the address specified by the user.
This caused problems because the receiving code requires the TCP connection and
the UDP connection to originate from the same IP address.

This patch adds support for the `BindToInterface' and `BindToAddress' options
to the setup of outgoing TCP connections.

Tested with Debian Etch on x86 and Debian Lenny on x86_64.

Signed-off-by: Florian Forster <octo@verplant.org>

No differences found