X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet_setup.c;h=f4246db25984e6a89ea19e12916bffdfca35e09b;hp=ccd600b730c41816a49363f0e55464e74cd6f81d;hb=a5f899a9794f215e8174455ead04862a2c14a5b1;hpb=0714ac6c59099a398e67770ad9c72fcec615812b diff --git a/src/net_setup.c b/src/net_setup.c index ccd600b7..f4246db2 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -1,7 +1,7 @@ /* net_setup.c -- Setup. Copyright (C) 1998-2005 Ivo Timmermans, - 2000-2006 Guus Sliepen + 2000-2008 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -286,7 +286,7 @@ bool setup_myself(void) if(get_config_bool(lookup_config(myself->connection->config_tree, "TCPOnly"), &choice) && choice) myself->options |= OPTION_TCPONLY; - if(get_config_bool(lookup_config(myself->connection->config_tree, "PMTUDiscovery"), &choice) && choice) + if(!get_config_bool(lookup_config(myself->connection->config_tree, "PMTUDiscovery"), &choice) || choice) myself->options |= OPTION_PMTU_DISCOVERY; if(myself->options & OPTION_TCPONLY) @@ -572,8 +572,14 @@ void close_network_connections(void) next = node->next; c = node->data; - if(c->outgoing) - free(c->outgoing->name), free(c->outgoing), c->outgoing = NULL; + if(c->outgoing) { + if(c->outgoing->ai) + freeaddrinfo(c->outgoing->ai); + free(c->outgoing->name); + free(c->outgoing); + c->outgoing = NULL; + } + terminate_connection(c, false); }