From: Werner Schreiber Date: Wed, 10 Oct 2018 17:16:59 +0000 (+0200) Subject: Fix segfault when dest->mtu is 0. X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=10527e172ec4293faa8499fea136c14ffaed510a;p=oweals%2Ftinc.git Fix segfault when dest->mtu is 0. --- diff --git a/src/route.c b/src/route.c index dcc6f3c..461ba14 100644 --- a/src/route.c +++ b/src/route.c @@ -598,7 +598,7 @@ static void fragment_ipv4_packet(node_t *dest, vpn_packet_t *packet, length_t et logger(DEBUG_TRAFFIC, LOG_INFO, "Fragmenting packet of %d bytes to %s (%s)", packet->len, dest->name, dest->hostname); offset = DATA(packet) + ether_size + ip_size; - maxlen = (dest->mtu - ether_size - ip_size) & ~0x7; + maxlen = (MAX(dest->mtu, 590) - ether_size - ip_size) & ~0x7; ip_off = ntohs(ip.ip_off); origf = ip_off & ~IP_OFFMASK; ip_off &= IP_OFFMASK;