netfilter: nft_payload: do not update layer 4 checksum when mangling fragments
[ Upstream commit4e1860a386
] IP fragments do not come with the transport header, hence skip bogus layer 4 checksum updates. Fixes:1814096980
("netfilter: nft_payload: layer 4 checksum adjustment for pseudoheader fields") Reported-and-tested-by: Steffen Weinreich <steve@weinreich.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Родитель
2db60bb564
Коммит
500193142a
|
@ -502,6 +502,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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче