By using this " bpf_skb_load_bytes_relative()" helper function we can directly 
retrieve the Network header data fields, so we no need to check for L2-header 
VLAN presence.

Thanks,
Madhuker.

-----Original Message-----
From: Stephen Hemminger <[email protected]> 
Sent: 05 January 2024 02:11
To: Madhuker Mythri <[email protected]>
Cc: [email protected]; [email protected]
Subject: [External] : Re: [PATCH] net/tap: Modified TAP BPF program as per the 
new Kernel-version upgrade requirements.

On Thu,  4 Jan 2024 22:57:56 +0530
[email protected] wrote:

> -     /* Get correct proto for 802.1ad */
> -     if (skb->vlan_present && skb->vlan_proto == htons(ETH_P_8021AD)) {
> -             if (data + ETH_ALEN * 2 + sizeof(struct vlan_hdr) +
> -                 sizeof(proto) > data_end)
> -                     return TC_ACT_OK;
> -             proto = *(__u16 *)(data + ETH_ALEN * 2 +
> -                                sizeof(struct vlan_hdr));
> -             off += sizeof(struct vlan_hdr);
> -     }

Your version loses VLAN support?

Reply via email to