A netmap slot holds frame data only. When the 802.1Q tag of a frame
is kept in the mbuf header (M_VLANTAG), the emulated adapter's receive
path and the host RX ring copy the frame without it, and the frame
leaves untagged once the application passes it on.
ether_input() moves the tag into the header before if_bridge(4) sees
the frame, whatever the member's vlanhwtag setting, so an application
in netmap mode on a bridge that carries tagged traffic, such as
Suricata in inline mode, removes every tag. The bridge then drops the
injected frame because it cannot find the source address in VLAN 0,
or forwards it untagged if the address was also learned untagged.
Frames that vlan(4) hands to a parent with VLAN_HWTAGGING lose their
tag the same way when the parent's host ring is open.
Put the tag back into the frame before queueing the mbuf. The stack
removes it again when the frame comes back from netmap. Add tests for
tagged traffic through a bridge in netmap mode, between members and
from a vlan(4) on the bridge.
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")