Commit de6843be authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nft_payload: rebuild vlan header when needed

Skip rebuilding the vlan header when accessing destination and source
mac address.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 4f325e26
...@@ -171,7 +171,8 @@ void nft_payload_eval(const struct nft_expr *expr, ...@@ -171,7 +171,8 @@ void nft_payload_eval(const struct nft_expr *expr,
if (!skb_mac_header_was_set(skb)) if (!skb_mac_header_was_set(skb))
goto err; 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, if (!nft_payload_copy_vlan(dest, skb,
priv->offset, priv->len)) priv->offset, priv->len))
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment