aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-03-18 14:43:47 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2020-03-18 18:17:54 -0600
commit2b8243a13f5a640de7bdade1005e903027ff1e12 (patch)
tree1f49fcfb17c0fda2845e044a646b17f25bcff7ff
parentnoise: error out precomputed DH during handshake rather than config (diff)
downloadwireguard-linux-compat-2b8243a13f5a640de7bdade1005e903027ff1e12.tar.xz
wireguard-linux-compat-2b8243a13f5a640de7bdade1005e903027ff1e12.zip
send: use normaler alignment formula from upstream
Slightly more meh, but upstream likes it better, and I'd rather minimize the delta between trees. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--src/send.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/send.c b/src/send.c
index 3c3f04e..9290bb9 100644
--- a/src/send.c
+++ b/src/send.c
@@ -147,7 +147,7 @@ static unsigned int calculate_skb_padding(struct sk_buff *skb)
unsigned int padded_size, last_unit = skb->len;
if (unlikely(!PACKET_CB(skb)->mtu))
- return -last_unit % MESSAGE_PADDING_MULTIPLE;
+ return ALIGN(last_unit, MESSAGE_PADDING_MULTIPLE) - last_unit;
/* We do this modulo business with the MTU, just in case the networking
* layer gives us a packet that's bigger than the MTU. In that case, we