]> git.meshlink.io Git - meshlink/commitdiff
Enable PMTU discovery by default.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 22 Dec 2008 20:35:45 +0000 (20:35 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 22 Dec 2008 20:35:45 +0000 (20:35 +0000)
src/net_setup.c
src/net_socket.c
src/protocol_auth.c

index f53127b5989085c5753018e8bb4eb9d7f020e503..f4246db25984e6a89ea19e12916bffdfca35e09b 100644 (file)
@@ -1,7 +1,7 @@
 /*
     net_setup.c -- Setup.
     Copyright (C) 1998-2005 Ivo Timmermans,
-                  2000-2006 Guus Sliepen <guus@tinc-vpn.org>
+                  2000-2008 Guus Sliepen <guus@tinc-vpn.org>
 
     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)
index c70be2f05368bb7c390d3de7c338d7403b046107..f7781bc4513a77c02cace6df3ae7fa89ab02d8fe 100644 (file)
@@ -195,7 +195,7 @@ int setup_vpn_in_socket(const sockaddr_t *sa)
        {
                bool choice;
 
-               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) {
                        option = IP_PMTUDISC_DO;
                        setsockopt(nfd, SOL_IP, IP_MTU_DISCOVER, &option, sizeof(option));
                }
@@ -206,7 +206,7 @@ int setup_vpn_in_socket(const sockaddr_t *sa)
        {
                bool choice;
 
-               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) {
                        option = IPV6_PMTUDISC_DO;
                        setsockopt(nfd, SOL_IPV6, IPV6_MTU_DISCOVER, &option, sizeof(option));
                }
index c806d7aa2a6206122918491e4e1541748a4dfcd5..cafe45c08e8951620c71321d2fdff1cad89f9694 100644 (file)
@@ -483,7 +483,7 @@ bool send_ack(connection_t *c)
        if((get_config_bool(lookup_config(c->config_tree, "TCPOnly"), &choice) && choice) || myself->options & OPTION_TCPONLY)
                c->options |= OPTION_TCPONLY | OPTION_INDIRECT;
 
-       if((get_config_bool(lookup_config(c->config_tree, "PMTUDiscovery"), &choice) && choice) || myself->options & OPTION_PMTU_DISCOVERY)
+       if((!get_config_bool(lookup_config(c->config_tree, "PMTUDiscovery"), &choice) || choice) || myself->options & OPTION_PMTU_DISCOVERY)
                c->options |= OPTION_PMTU_DISCOVERY;
 
        get_config_int(lookup_config(c->config_tree, "Weight"), &c->estimated_weight);