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