From 6d41b429a26dd1acaa7c56b2124f2daf55b5b97c Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 20 Dec 2003 21:25:17 +0000 Subject: [PATCH] Better name, show probed MTU in dump. --- src/connection.h | 4 ++-- src/graph.c | 4 ++-- src/net_setup.c | 4 ++-- src/node.c | 6 +++--- src/protocol_auth.c | 6 +++--- src/protocol_key.c | 4 ++-- src/route.c | 6 +++--- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/connection.h b/src/connection.h index 175bf7ce..b1c35af2 100644 --- a/src/connection.h +++ b/src/connection.h @@ -17,7 +17,7 @@ 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__ @@ -30,7 +30,7 @@ #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 */ diff --git a/src/graph.c b/src/graph.c index c1773470..757210cc 100644 --- a/src/graph.c +++ b/src/graph.c @@ -17,7 +17,7 @@ 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: @@ -230,7 +230,7 @@ void sssp_bfs(void) 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; diff --git a/src/net_setup.c b/src/net_setup.c index b2841356..4ad44fb5 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -17,7 +17,7 @@ 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" @@ -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_DONTFRAGMENT; + myself->options |= OPTION_PMTU_DISCOVERY; if(myself->options & OPTION_TCPONLY) myself->options |= OPTION_INDIRECT; diff --git a/src/node.c b/src/node.c index e0639149..4b21d5ba 100644 --- a/src/node.c +++ b/src/node.c @@ -17,7 +17,7 @@ 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" @@ -180,11 +180,11 @@ void dump_nodes(void) 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->via ? n->via->name : "-"); + n->via ? n->via->name : "-", n->probedmtu); } logger(LOG_DEBUG, _("End of nodes.")); diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 5e960ea5..94e602f7 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -17,7 +17,7 @@ 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" @@ -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, "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); } diff --git a/src/protocol_key.c b/src/protocol_key.c index b8b1f223..5067a818 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -17,7 +17,7 @@ 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" @@ -267,7 +267,7 @@ bool ans_key_h(connection_t *c) return false; } - if(from->options & OPTION_DONTFRAGMENT && !from->mtuprobes) + if(from->options & OPTION_PMTU_DISCOVERY && !from->mtuprobes) send_mtu_probe(from); flush_queue(from); diff --git a/src/route.c b/src/route.c index 8924329b..367926ea 100644 --- a/src/route.c +++ b/src/route.c @@ -17,7 +17,7 @@ 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" @@ -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->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); @@ -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->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); -- 2.20.1