From: Guus Sliepen <guus@tinc-vpn.org>
Date: Sat, 24 Oct 2009 19:35:40 +0000 (+0200)
Subject: Make maxmtu equal to minmtu when fixing the path MTU to a node.
X-Git-Tag: release-1.0.11~8
X-Git-Url: http://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=d922db253cd098bc038449e5c591cc94c1019952;p=tinc

Make maxmtu equal to minmtu when fixing the path MTU to a node.

This ensures MTU probes used to ping nodes are not too large, and prevents
restarting MTU probing unnecessarily.
---

diff --git a/src/net_packet.c b/src/net_packet.c
index 626f8b1c..3466f87e 100644
--- a/src/net_packet.c
+++ b/src/net_packet.c
@@ -91,6 +91,10 @@ void send_mtu_probe(node_t *n) {
 	}
 
 	if(n->mtuprobes == 30 || (n->mtuprobes < 30 && n->minmtu >= n->maxmtu)) {
+		if(n->minmtu > n->maxmtu)
+			n->minmtu = n->maxmtu;
+		else
+			n->maxmtu = n->minmtu;
 		n->mtu = n->minmtu;
 		ifdebug(TRAFFIC) logger(LOG_INFO, "Fixing MTU of %s (%s) to %d after %d probes", n->name, n->hostname, n->mtu, n->mtuprobes);
 		n->mtuprobes = 31;