Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Jakub Sitnicki and committed by
Martin KaFai Lau
efd35c26 b85be58e

+1 -1
+1 -1
include/linux/if_vlan.h
··· 738 738 739 739 *vlan_tci = ntohs(vhdr->h_vlan_TCI); 740 740 741 - memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN); 742 741 vlan_set_encap_proto(skb, vhdr); 743 742 __skb_pull(skb, VLAN_HLEN); 743 + skb_postpull_data_move(skb, VLAN_HLEN, 2 * ETH_ALEN); 744 744 } 745 745 746 746 /**