mirror of
https://github.com/torvalds/linux.git
synced 2024-11-12 07:01:57 +00:00
netfilter: nf_tables: nft_payload: fix transport header base
We cannot use skb->transport_header since it's unset, use pkt->xt.thoff instead. Now possible using information made available through the x_tables compatibility layer. Reported-by: Eric Leblond <eric@regit.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
0ca743a559
commit
c54032e05b
@ -44,7 +44,7 @@ static bool nft_payload_fast_eval(const struct nft_expr *expr,
|
||||
if (priv->base == NFT_PAYLOAD_NETWORK_HEADER)
|
||||
ptr = skb_network_header(skb);
|
||||
else
|
||||
ptr = skb_transport_header(skb);
|
||||
ptr = skb_network_header(skb) + pkt->xt.thoff;
|
||||
|
||||
ptr += priv->offset;
|
||||
|
||||
|
@ -36,7 +36,7 @@ static void nft_payload_eval(const struct nft_expr *expr,
|
||||
offset = skb_network_offset(skb);
|
||||
break;
|
||||
case NFT_PAYLOAD_TRANSPORT_HEADER:
|
||||
offset = skb_transport_offset(skb);
|
||||
offset = pkt->xt.thoff;
|
||||
break;
|
||||
default:
|
||||
BUG();
|
||||
|
Loading…
Reference in New Issue
Block a user