socket-default: Properly initialize NAT-T port if opening regular socket failed

This commit is contained in:
Tobias Brunner
2013-06-14 16:42:56 +02:00
parent 92f102c21b
commit 1889837767
@@ -615,7 +615,7 @@ static int open_socket(private_socket_default_socket_t *this,
}
/**
* Open a socket pair (normal an NAT traversal) for a given address family
* Open a socket pair (normal and NAT traversal) for a given address family
*/
static void open_socketpair(private_socket_default_socket_t *this, int family,
int *skt, int *skt_natt, char *label)
@@ -623,6 +623,7 @@ static void open_socketpair(private_socket_default_socket_t *this, int family,
*skt = open_socket(this, family, &this->port);
if (*skt == -1)
{
*skt_natt = -1;
DBG1(DBG_NET, "could not open %s socket, %s disabled", label, label);
}
else