diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-06-06 09:38:42 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-06-26 08:05:45 +0200 |
commit | de6843be3082d416eaf2a00b72dad95c784ca980 (patch) | |
tree | 00e39c3f0dc6bbbacdd6789466556be9b328356c /net/netfilter | |
parent | 4f325e26277b6a1381235008ca6fa97e6cc8f43b (diff) | |
download | linux-stable-de6843be3082d416eaf2a00b72dad95c784ca980.tar.gz linux-stable-de6843be3082d416eaf2a00b72dad95c784ca980.tar.bz2 linux-stable-de6843be3082d416eaf2a00b72dad95c784ca980.zip |
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 <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nft_payload.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/nft_payload.c b/net/netfilter/nft_payload.c index 3a3c7746e88f..8cb800989947 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; |