hello. In looking at various ethernet drivers, as well as the if_ether.h file, which contains the macros for vlan tagged input packets, it looks to me like most of the ethernet drivers do things in the wrong order. Most drivers do:
1. Receive the packet. 2. Setup the mbufs for the packet. 3. Check for vlan tags and unwrap them, prepending the tag to the mbuf chain. 4. Fix any checksum flags for the uper layers. 5. Send the packet to bpf. 6. Send the packet to ether_input(). However, some drivers, i.e. stge(4), send the packet to the bpf engine after step 2, above, before performing steps 3, 4 and 6. Without having tested anything yet, this seems more correct to me. I will try to get a test environment together with some chips capable of doing hardware vlan tagging extraction (with this code enabled), other chips not capable of hardware vlan tag extraction and a test with the bpf call moved up the list of items to be completed on the receipt of a packet. If anyone has any thoughts they'd like to share that might save me some time in this endeavor, I'm all for hearing them. -thanks -Brian On Nov 28, 7:23pm, David Young wrote: } Subject: Re: Broadcast traffic on vlans leaks into the parent interface on } On Wed, Nov 28, 2012 at 07:27:56PM -0500, Greg Troxel wrote: } > } > dhcpd, last I checked, used bpf and not sockets. } > } > If dhcpd is bpf, I would suggest reading the bpf_tap calls in the } > driver. It could be that if_wm.c has a spurious on. } > } > If it's not, I don't know what's going on. } } I'll bet this has something to do with the hardware VLAN tagging. I } don't think BPF groks the VLAN mbuf tags. } } FWIW, I think that hardware VLAN tagging is a lot of pain for no gain } the way that NetBSD is doing it. } } Dave } } -- } David Young } dyo...@pobox.com Urbana, IL (217) 721-9981 >-- End of excerpt from David Young