From: Pablo Neira Ayuso Date: Tue, 6 Jun 2023 07:38:42 +0000 (+0200) Subject: netfilter: nft_payload: rebuild vlan header when needed X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=de6843be3082d416eaf2a00b72dad95c784ca980;p=linux.git 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 --- diff --git a/net/netfilter/nft_payload.c b/net/netfilter/nft_payload.c index 3a3c7746e88fe..8cb8009899479 100644 --- a/net/netfilter/nft_payload.c +++ b/net/netfilter/nft_payload.c @@ -171,7 +171,8 @@ void nft_payload_eval(const struct nft_expr *expr, if (!skb_mac_header_was_set(skb)) goto err; - if (skb_vlan_tag_present(skb)) { + if (skb_vlan_tag_present(skb) && + priv->offset >= offsetof(struct ethhdr, h_proto)) { if (!nft_payload_copy_vlan(dest, skb, priv->offset, priv->len)) goto err;