Patrick McHardy wrote: > Joonwoo Park wrote: >> Patrick, >> Do you mind inserting a new flag to indicate vlan_tag is just for >> af_packet or not into sk_buff? >> I think if flag exists, we can pass vlan_tag to af_packet with just >> modifications of vlan_get_tag(), vlan_put_tag() and >> vlan_tag_present(), >> without patching for invalidation. > > I've considered this, but that would mean that we report > the vlan tag for all devices layered on top, which seems > wrong. > > For now I think I'm going to temporarily do something like > that so I can continue integrating the remaining patches > and fix it properly later. The entire idea didn't work out too well. Your original patch passed packets for unknown VLANs to netif_receive_skb again, but since they don't have a VLAN header, they are treated like a normal non-VLAN packet and might end up in a protocol handler instead of getting dropped. It would also have left one inconsistency, for locally configured VLANs the packet is still not visible on the lower device. This patch (on top of my local tree with other changes, I'll post the entire series soon) takes a different approach. __vlan_hwaccel_rx() is supposed to behave similar to netif_receive_skb(), so the easiest fix is to make it behave more like netif_receive_skb() and deliver packets to ptype_all handlers manually.