Disable Ethernet VLAN filter to enable raw packet capture

I am writing quite sophisticated software running on an almost exclusive Ethernet layer-2. The system is really reduced - the kernel has no file systems, no IP stack (yes, only Ethernet drivers and CONFIG_PACKET- I implemented rudimentary ARP and IP without fragmentation, without routing tables, etc.). I capture and emit packets using PACKET_MMAP, and it works well.

I have one small problem. I would like to capture and emit both tags with VLAN and untagged packets. The IOCTLs used by vconfig and friends create a new virtual Ethernet device for each vlan. I don’t need such functionality - I just need to catch everything on one side and emit it somehow on the other.

This could probably be achieved by giving the NIC the right kick. I looked through the source code (I have a dual VIA Velocity on board) and did not find any clues on how to kill the VLAN filter.

+3
source share

All Articles