Skip to content

Commit 6972504

Browse files
committed
common/parsing_helpers.h: add comment to parse_ethhdr()
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
1 parent b941ce5 commit 6972504

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

common/parsing_helpers.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ static __always_inline int proto_is_vlan(__u16 h_proto)
6262
h_proto == bpf_htons(ETH_P_8021AD));
6363
}
6464

65+
/* Notice, parse_ethhdr() will skip VLAN tags, by advancing nh->pos and returns
66+
* next header EtherType, BUT the ethhdr pointer supplied still points to the
67+
* Ethernet header. Thus, caller can look at eth->h_proto to see if this was a
68+
* VLAN tagged packet.
69+
*/
6570
static __always_inline int parse_ethhdr(struct hdr_cursor *nh, void *data_end,
6671
struct ethhdr **ethhdr)
6772
{

0 commit comments

Comments
 (0)