Skip to content

Commit 4e1860a

Browse files
committed
netfilter: nft_payload: do not update layer 4 checksum when mangling fragments
IP fragments do not come with the transport header, hence skip bogus layer 4 checksum updates. Fixes: 1814096 ("netfilter: nft_payload: layer 4 checksum adjustment for pseudoheader fields") Reported-and-tested-by: Steffen Weinreich <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 1585f59 commit 4e1860a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/netfilter/nft_payload.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ static int nft_payload_l4csum_offset(const struct nft_pktinfo *pkt,
546546
struct sk_buff *skb,
547547
unsigned int *l4csum_offset)
548548
{
549+
if (pkt->fragoff)
550+
return -1;
551+
549552
switch (pkt->tprot) {
550553
case IPPROTO_TCP:
551554
*l4csum_offset = offsetof(struct tcphdr, check);

0 commit comments

Comments
 (0)