summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJakub Sitnicki <jakub@cloudflare.com>2025-11-05 21:19:42 +0100
committerMartin KaFai Lau <martin.lau@kernel.org>2025-11-10 10:52:31 -0800
commitefd35c26239bed39193201e958d65e695231ccda (patch)
treee76b6f417245b5f4fe29320ec5271d25d51d953b /include
parentb85be58e2f7cff47f7477ae61022644a198ee592 (diff)
bpf: Make bpf_skb_vlan_pop helper metadata-safe
Use the metadata-aware helper to move packet bytes after skb_pull(), ensuring metadata remains valid after calling the BPF helper. Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Link: https://patch.msgid.link/20251105-skb-meta-rx-path-v4-5-5ceb08a9b37b@cloudflare.com
Diffstat (limited to 'include')
-rw-r--r--include/linux/if_vlan.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index afa5cc61a0fa..4ecc2509b0d4 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -738,9 +738,9 @@ static inline void vlan_remove_tag(struct sk_buff *skb, u16 *vlan_tci)
*vlan_tci = ntohs(vhdr->h_vlan_TCI);
- memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN);
vlan_set_encap_proto(skb, vhdr);
__skb_pull(skb, VLAN_HLEN);
+ skb_postpull_data_move(skb, VLAN_HLEN, 2 * ETH_ALEN);
}
/**