tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: vlan and bpf



 ---- On Fri, 15 Dec 2023 18:47:54 +0000  Mouse  wrote --- 
 > Again, I would expect to find it in the packet, bytes [14] and [15]
 > containing the tag and priority, but, depending on the use case, "need"
 > may or may not be appropriate.
 > 
 > If you're stuck with hardware that insists on stripping VLAN tags, IMO
 > the only sane thing is to synthesize the stripped 4 octets for
 > presentation via bpf.

Sane or not, you don't see VLAN tags in Linux BPF.
They move ancillary data such as that to a negative offset (which is invalid in BPF syntax)
https://github.com/torvalds/linux/blob/7acac4b3196caee5e21fb5ea53f8bc124e6a16fc/include/uapi/linux/filter.h#L60

They have more there than just VLAN, so if we feel the urge to do anything more, it might be something to consider.
I'm not advocating for one or the other, just noting it as a datapoint.

Roy


Home | Main Index | Thread Index | Old Index