Skip to content

Commit ffba649

Browse files
committed
packet-solutions: xdp_vlan02_kern VLAN extraction missed bpf_ntohs()
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
1 parent ec2be4e commit ffba649

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packet-solutions/xdp_vlan02_kern.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ static __always_inline int __parse_ethhdr_vlan(struct hdr_cursor *nh,
5151

5252
h_proto = vlh->h_vlan_encapsulated_proto;
5353
if (vlans) {
54-
vlans->id[i] = vlh->h_vlan_TCI & VLAN_VID_MASK;
54+
vlans->id[i] =
55+
bpf_ntohs(vlh->h_vlan_TCI) & VLAN_VID_MASK;
5556
}
5657
vlh++;
5758
}

0 commit comments

Comments
 (0)