projects
/
oweals
/
tinc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ebadf1
)
Fix segfault when dest->mtu is 0.
author
Werner Schreiber
<werner@perfect-privacy.com>
Wed, 10 Oct 2018 17:16:59 +0000
(19:16 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Thu, 18 Oct 2018 15:07:19 +0000
(17:07 +0200)
src/route.c
patch
|
blob
|
history
diff --git
a/src/route.c
b/src/route.c
index dcc6f3c6bfc32d9d2824ce342ee23027c613dec0..461ba14a7cac9c80020e69309bbdcfb1ada2465a 100644
(file)
--- 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;