aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/queueing.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-04-14 05:27:19 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-04-15 15:45:13 +0200
commita1525bfdccc7fabf35c6c538409e4de4c4812169 (patch)
tree81427f89c2bbf51aef4cde1e873c66a509851c28 /src/queueing.h
parentwg-quick: account for specified fwmark in auto routing mode (diff)
downloadwireguard-monolithic-historical-a1525bfdccc7fabf35c6c538409e4de4c4812169.tar.xz
wireguard-monolithic-historical-a1525bfdccc7fabf35c6c538409e4de4c4812169.zip
send: account for route-based MTU
It might be that a particular route has a different MTU than the interface, via `ip route add ... dev wg0 mtu 1281`, for example. In this case, it's important that we don't accidently pad beyond the end of the MTU. We accomplish that in this patch by carrying forward the MTU from the dst if it exists. We also add a unit test for this issue. Reported-by: Roman Mamedov <rm.wg@romanrm.net>
Diffstat (limited to 'src/queueing.h')
-rw-r--r--src/queueing.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/queueing.h b/src/queueing.h
index d5948f3..c507536 100644
--- a/src/queueing.h
+++ b/src/queueing.h
@@ -46,6 +46,7 @@ struct packet_cb {
u64 nonce;
struct noise_keypair *keypair;
atomic_t state;
+ u32 mtu;
u8 ds;
};
#define PACKET_PEER(skb) (((struct packet_cb *)skb->cb)->keypair->entry.peer)