Better name, show probed MTU in dump.
authorGuus Sliepen <guus@tinc-vpn.org>
Sat, 20 Dec 2003 21:25:17 +0000 (21:25 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 20 Dec 2003 21:25:17 +0000 (21:25 +0000)
src/connection.h
src/graph.c
src/net_setup.c
src/node.c
src/protocol_auth.c
src/protocol_key.c
src/route.c

index 175bf7ce62dd5ecca06c14bf615b3ea92a60948a..b1c35af25b6cff7565f3a24c34cc37f80dddbbec 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: connection.h,v 1.1.2.39 2003/12/20 19:47:52 guus Exp $
+    $Id: connection.h,v 1.1.2.40 2003/12/20 21:25:17 guus Exp $
 */
 
 #ifndef __TINC_CONNECTION_H__
 */
 
 #ifndef __TINC_CONNECTION_H__
@@ -30,7 +30,7 @@
 
 #define OPTION_INDIRECT                0x0001
 #define OPTION_TCPONLY         0x0002
 
 #define OPTION_INDIRECT                0x0001
 #define OPTION_TCPONLY         0x0002
-#define OPTION_DONTFRAGMENT    0x0004
+#define OPTION_PMTU_DISCOVERY  0x0004
 
 typedef struct connection_status_t {
        int pinged:1;                           /* sent ping */
 
 typedef struct connection_status_t {
        int pinged:1;                           /* sent ping */
index c177347060786fdcc1f8ef574d7d3edc409c6c1b..757210cc9002248bc7d8c8cd247d7d826fb69f0e 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: graph.c,v 1.1.2.32 2003/12/20 21:09:33 guus Exp $
+    $Id: graph.c,v 1.1.2.33 2003/12/20 21:25:17 guus Exp $
 */
 
 /* We need to generate two trees from the graph:
 */
 
 /* We need to generate two trees from the graph:
@@ -230,7 +230,7 @@ void sssp_bfs(void)
                                        e->to->hostname = sockaddr2hostname(&e->to->address);
                                        avl_insert_node(node_udp_tree, node);
 
                                        e->to->hostname = sockaddr2hostname(&e->to->address);
                                        avl_insert_node(node_udp_tree, node);
 
-                                       if(e->to->options & OPTION_DONTFRAGMENT) {
+                                       if(e->to->options & OPTION_PMTU_DISCOVERY) {
                                                e->to->mtu = MTU;
                                                e->to->mtuprobes = 0;
                                                e->to->probedmtu = 0;
                                                e->to->mtu = MTU;
                                                e->to->mtuprobes = 0;
                                                e->to->probedmtu = 0;
index b28413564ddc0b3a7ad3bade8dad1bc9b3b774c8..4ad44fb5cfba016e83ec09eda179acf96a5fd992 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: net_setup.c,v 1.1.2.49 2003/12/20 21:09:33 guus Exp $
+    $Id: net_setup.c,v 1.1.2.50 2003/12/20 21:25:17 guus Exp $
 */
 
 #include "system.h"
 */
 
 #include "system.h"
@@ -285,7 +285,7 @@ bool setup_myself(void)
                myself->options |= OPTION_TCPONLY;
 
        if(get_config_bool(lookup_config(myself->connection->config_tree, "PMTUDiscovery"), &choice) && choice)
                myself->options |= OPTION_TCPONLY;
 
        if(get_config_bool(lookup_config(myself->connection->config_tree, "PMTUDiscovery"), &choice) && choice)
-               myself->options |= OPTION_DONTFRAGMENT;
+               myself->options |= OPTION_PMTU_DISCOVERY;
 
        if(myself->options & OPTION_TCPONLY)
                myself->options |= OPTION_INDIRECT;
 
        if(myself->options & OPTION_TCPONLY)
                myself->options |= OPTION_INDIRECT;
index e0639149a3fce482f0c95ea08e95edfc8b9da54f..4b21d5baf99e80eed07dd3692934bf796b83df34 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: node.c,v 1.1.2.29 2003/12/20 19:47:52 guus Exp $
+    $Id: node.c,v 1.1.2.30 2003/12/20 21:25:17 guus Exp $
 */
 
 #include "system.h"
 */
 
 #include "system.h"
@@ -180,11 +180,11 @@ void dump_nodes(void)
 
        for(node = node_tree->head; node; node = node->next) {
                n = node->data;
 
        for(node = node_tree->head; node; node = node->next) {
                n = node->data;
-               logger(LOG_DEBUG, _(" %s at %s cipher %d digest %d maclength %d compression %d options %lx status %04x nexthop %s via %s"),
+               logger(LOG_DEBUG, _(" %s at %s cipher %d digest %d maclength %d compression %d options %lx status %04x nexthop %s via %s probedmtu %d"),
                           n->name, n->hostname, n->cipher ? n->cipher->nid : 0,
                           n->digest ? n->digest->type : 0, n->maclength, n->compression,
                           n->options, *(uint32_t *)&n->status, n->nexthop ? n->nexthop->name : "-",
                           n->name, n->hostname, n->cipher ? n->cipher->nid : 0,
                           n->digest ? n->digest->type : 0, n->maclength, n->compression,
                           n->options, *(uint32_t *)&n->status, n->nexthop ? n->nexthop->name : "-",
-                          n->via ? n->via->name : "-");
+                          n->via ? n->via->name : "-", n->probedmtu);
        }
 
        logger(LOG_DEBUG, _("End of nodes."));
        }
 
        logger(LOG_DEBUG, _("End of nodes."));
index 5e960ea5fc53e199b8610ab1c4a7babf3a9a9569..94e602f74c9c5a7dcc57cc5ac1b69319a9b37701 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol_auth.c,v 1.1.4.32 2003/12/20 21:09:33 guus Exp $
+    $Id: protocol_auth.c,v 1.1.4.33 2003/12/20 21:25:17 guus Exp $
 */
 
 #include "system.h"
 */
 
 #include "system.h"
@@ -476,8 +476,8 @@ 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, "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_DONTFRAGMENT)
-               c->options |= OPTION_DONTFRAGMENT;
+       if((get_config_bool(lookup_config(c->config_tree, "PMTUDiscovery"), &choice) && choice) || myself->options & OPTION_PMTU_DISCOVERY)
+               c->options |= OPTION_PMTU_DISCOVERY;
 
        return send_request(c, "%d %s %d %lx", ACK, myport, c->estimated_weight, c->options);
 }
 
        return send_request(c, "%d %s %d %lx", ACK, myport, c->estimated_weight, c->options);
 }
index b8b1f22379289fbaba071d7cdaa6d76bad827572..5067a818d15401fa94a68e1bd88f257b3ce18d6b 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol_key.c,v 1.1.4.25 2003/12/20 19:47:53 guus Exp $
+    $Id: protocol_key.c,v 1.1.4.26 2003/12/20 21:25:17 guus Exp $
 */
 
 #include "system.h"
 */
 
 #include "system.h"
@@ -267,7 +267,7 @@ bool ans_key_h(connection_t *c)
                        return false;
                }
 
                        return false;
                }
 
-       if(from->options & OPTION_DONTFRAGMENT && !from->mtuprobes)
+       if(from->options & OPTION_PMTU_DISCOVERY && !from->mtuprobes)
                send_mtu_probe(from);
 
        flush_queue(from);
                send_mtu_probe(from);
 
        flush_queue(from);
index 8924329bcb44607ec91af2d575e95172bc3649ca..367926ea035fd0b102cd4b83baf59c85201438df 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: route.c,v 1.1.2.72 2003/12/20 19:47:53 guus Exp $
+    $Id: route.c,v 1.1.2.73 2003/12/20 21:25:17 guus Exp $
 */
 
 #include "system.h"
 */
 
 #include "system.h"
@@ -304,7 +304,7 @@ static __inline__ void route_ipv4_unicast(node_t *source, vpn_packet_t *packet)
        if(!subnet->owner->status.reachable)
                route_ipv4_unreachable(source, packet, ICMP_DEST_UNREACH, ICMP_NET_UNREACH);
 
        if(!subnet->owner->status.reachable)
                route_ipv4_unreachable(source, packet, ICMP_DEST_UNREACH, ICMP_NET_UNREACH);
 
-       if(subnet->owner->options & OPTION_DONTFRAGMENT && packet->len > subnet->owner->mtu && subnet->owner != myself) {
+       if(subnet->owner->options & OPTION_PMTU_DISCOVERY && packet->len > subnet->owner->mtu && subnet->owner != myself) {
                ifdebug(TRAFFIC) logger(LOG_INFO, _("Packet for %s (%s) length %d larger than MTU %d"), subnet->owner->name, subnet->owner->hostname, packet->len, subnet->owner->mtu);
                packet->len = subnet->owner->mtu;
                route_ipv4_unreachable(source, packet, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED);
                ifdebug(TRAFFIC) logger(LOG_INFO, _("Packet for %s (%s) length %d larger than MTU %d"), subnet->owner->name, subnet->owner->hostname, packet->len, subnet->owner->mtu);
                packet->len = subnet->owner->mtu;
                route_ipv4_unreachable(source, packet, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED);
@@ -438,7 +438,7 @@ static __inline__ void route_ipv6_unicast(node_t *source, vpn_packet_t *packet)
        if(!subnet->owner->status.reachable)
                route_ipv6_unreachable(source, packet, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOROUTE);
        
        if(!subnet->owner->status.reachable)
                route_ipv6_unreachable(source, packet, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOROUTE);
        
-       if(subnet->owner->options & OPTION_DONTFRAGMENT && packet->len > subnet->owner->mtu && subnet->owner != myself) {
+       if(subnet->owner->options & OPTION_PMTU_DISCOVERY && packet->len > subnet->owner->mtu && subnet->owner != myself) {
                ifdebug(TRAFFIC) logger(LOG_INFO, _("Packet for %s (%s) length %d larger than MTU %d"), subnet->owner->name, subnet->owner->hostname, packet->len, subnet->owner->mtu);
                packet->len = subnet->owner->mtu;
                route_ipv6_unreachable(source, packet, ICMP6_PACKET_TOO_BIG, 0);
                ifdebug(TRAFFIC) logger(LOG_INFO, _("Packet for %s (%s) length %d larger than MTU %d"), subnet->owner->name, subnet->owner->hostname, packet->len, subnet->owner->mtu);
                packet->len = subnet->owner->mtu;
                route_ipv6_unreachable(source, packet, ICMP6_PACKET_TOO_BIG, 0);