Commit 4e1860a3 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

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: 18140969 ("netfilter: nft_payload: layer 4 checksum adjustment for pseudoheader fields")
Reported-and-tested-by: default avatarSteffen Weinreich <steve@weinreich.org>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 1585f590
......@@ -546,6 +546,9 @@ static int nft_payload_l4csum_offset(const struct nft_pktinfo *pkt,
struct sk_buff *skb,
unsigned int *l4csum_offset)
{
if (pkt->fragoff)
return -1;
switch (pkt->tprot) {
case IPPROTO_TCP:
*l4csum_offset = offsetof(struct tcphdr, check);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment