From: Werner Schreiber Date: Wed, 10 Oct 2018 17:16:59 +0000 (+0200) Subject: Fix segfault when dest->mtu is 0. X-Git-Tag: release-1.0.36~10 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=228a03aaa707a5fcced9dd5148a4bdb7e5ef025b;p=oweals%2Ftinc.git Fix segfault when dest->mtu is 0. --- diff --git a/src/route.c b/src/route.c index 850a146..f8b11bb 100644 --- a/src/route.c +++ b/src/route.c @@ -581,7 +581,7 @@ static void fragment_ipv4_packet(node_t *dest, vpn_packet_t *packet, length_t et ifdebug(TRAFFIC) logger(LOG_INFO, "Fragmenting packet of %d bytes to %s (%s)", packet->len, dest->name, dest->hostname); offset = packet->data + 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;