From 2b8243a13f5a640de7bdade1005e903027ff1e12 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 18 Mar 2020 14:43:47 -0600 Subject: 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 --- src/send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3-59-g8ed1b