VLAN ID 0 is supposed to be interpreted as having no VLAN with
a bit of priority on the side, but the kernel is not able to
decapsulate this on the fly so dhclient needs to take care of it.
Yes, saves time.
I did this first back in 2018 so I had to take a closer look. Comments may not be well-rounded.
The biggest issue was that BPF_MSH wasn't going to the index based on variable offset through IP or VLAN situation requiring a static comparison between both cases and calculating the result moving it back.
There is an older discussion about it here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224961
Handling it transparently in BPF would avoid the need to do this particular dance, fix all potential consumers and is probably faster. Handling it in the network stack on the other hand is probably a lot of work but would fix non-BPF use cases as well.
FWIW, so far our only report about this in OPNsense was dhclient, but I could look into the BPF approach instead?
Added motivation for checking for untagged priority to the filter program comments.
After scanning the code I don't feel comfortable bringing the support to bpf(4) in general so this dhclient change is all I can offer at this point.
In any case thanks for review and questions!