Skip to content

Commit

Permalink
netfilter: nf_tables: nft_payload: fix transport header base
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pablo Neira Ayuso committed Oct 14, 2013
1 parent 0ca743a commit c54032e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/netfilter/nf_tables_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/nft_payload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit c54032e

Please sign in to comment.