X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=src%2Fnet_packet.c;h=ee3026a64eeee5f3b3a51cb717067848d87be8da;hb=c217d214f4f071c235bc7c463a1da6124e2570a6;hp=5e503f581c3ff9c9dc0725309b462ef471ad0d98;hpb=66be914d35cb7e7ea4dd4aed68ae9e41addd9f70;p=tinc diff --git a/src/net_packet.c b/src/net_packet.c index 5e503f58..ee3026a6 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -16,8 +16,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ */ #include "system.h" @@ -71,7 +69,7 @@ void send_mtu_probe(node_t *n) n->mtuevent = NULL; if(!n->status.reachable) { - ifdebug(TRAFFIC) logger(LOG_INFO, _("Trying to send MTU probe to unreachable node %s (%s)"), n->name, n->hostname); + logger(LOG_DEBUG, _("Trying to send MTU probe to unreachable node %s (%s)"), n->name, n->hostname); return; } @@ -87,7 +85,7 @@ void send_mtu_probe(node_t *n) return; } - len = n->minmtu + 1 + random() % (n->maxmtu - n->minmtu); + len = n->minmtu + 1 + rand() % (n->maxmtu - n->minmtu); if(len < 64) len = 64; @@ -355,9 +353,9 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt) return; } - if(n->options & OPTION_PMTU_DISCOVERY && !n->minmtu && (inpkt->data[12] | inpkt->data[13])) { + if(n->options & OPTION_PMTU_DISCOVERY && inpkt->len > n->minmtu && (inpkt->data[12] | inpkt->data[13])) { ifdebug(TRAFFIC) logger(LOG_INFO, - _("No minimum MTU established yet for %s (%s), forwarding via TCP"), + _("Packet for %s (%s) larger than minimum MTU, forwarding via TCP"), n->name, n->hostname); send_tcppacket(n->nexthop->connection, origpkt);