Skip to content

Commit de6843b

Browse files
committed
netfilter: nft_payload: rebuild vlan header when needed
Skip rebuilding the vlan header when accessing destination and source mac address. Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 4f325e2 commit de6843b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/netfilter/nft_payload.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ void nft_payload_eval(const struct nft_expr *expr,
171171
if (!skb_mac_header_was_set(skb))
172172
goto err;
173173

174-
if (skb_vlan_tag_present(skb)) {
174+
if (skb_vlan_tag_present(skb) &&
175+
priv->offset >= offsetof(struct ethhdr, h_proto)) {
175176
if (!nft_payload_copy_vlan(dest, skb,
176177
priv->offset, priv->len))
177178
goto err;

0 commit comments

Comments
 (0)