From 18898377675cc1a752e310615a7dae1bfaa831b2 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 14 Jun 2013 16:41:33 +0200 Subject: socket-default: Properly initialize NAT-T port if opening regular socket failed --- src/libcharon/plugins/socket_default/socket_default_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcharon/plugins/socket_default/socket_default_socket.c b/src/libcharon/plugins/socket_default/socket_default_socket.c index a9c298362..6b89b4caa 100644 --- a/src/libcharon/plugins/socket_default/socket_default_socket.c +++ b/src/libcharon/plugins/socket_default/socket_default_socket.c @@ -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 -- cgit v1.2.3