Add the ListenAddress option.

ListenAddress works the same as BindToAddress, except that from now on,
explicitly binding outgoing packets to the address of a socket is only done for
sockets specified with BindToAddress.
This commit is contained in:
Guus Sliepen 2014-01-20 21:19:13 +01:00
parent e187758a7e
commit 38adc8bf54
7 changed files with 144 additions and 92 deletions

View file

@ -116,7 +116,7 @@ static bool bind_to_interface(int sd) {
static bool bind_to_address(connection_t *c) {
int s = -1;
for(int i = 0; i < listen_sockets; i++) {
for(int i = 0; i < listen_sockets && listen_socket[i].bindto; i++) {
if(listen_socket[i].sa.sa.sa_family != c->address.sa.sa_family)
continue;
if(s >= 0)