From 5cb7a0d7be0699ee5c3e1cbdfd505c81f8e2597e Mon Sep 17 00:00:00 2001 From: Adam Kiripolsky Date: Thu, 25 Jun 2026 15:52:35 +0200 Subject: [PATCH] xdp: fix vlan byte order Change the byte order of vlan TCI when extracting it from vlan_hdr in xdp_filter.c. This fixes xdp bypass for vlan tagged packets, as without the fix flows that are supposed to be bypassed by the xdp filter are not bypassed. Ticket: 8699 --- ebpf/xdp_filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ebpf/xdp_filter.c b/ebpf/xdp_filter.c index 6c5e8b644a..7b3db7b2b8 100644 --- a/ebpf/xdp_filter.c +++ b/ebpf/xdp_filter.c @@ -523,7 +523,7 @@ int SEC("xdp") xdp_hashfilter(struct xdp_md *ctx) return XDP_PASS; h_proto = vhdr->h_vlan_encapsulated_proto; #if VLAN_TRACKING - vlan0 = vhdr->h_vlan_TCI & 0x0fff; + vlan0 = __constant_ntohs(vhdr->h_vlan_TCI) & 0x0fff; #else vlan0 = 0; #endif @@ -537,7 +537,7 @@ int SEC("xdp") xdp_hashfilter(struct xdp_md *ctx) return XDP_PASS; h_proto = vhdr->h_vlan_encapsulated_proto; #if VLAN_TRACKING - vlan1 = vhdr->h_vlan_TCI & 0x0fff; + vlan1 = __constant_ntohs(vhdr->h_vlan_TCI) & 0x0fff; #else vlan1 = 0; #endif