Page MenuHomeFreeBSD

bridge: Make the vlan(4) shunt more robust
ClosedPublic

Authored by ivy on Fri, Aug 1, 4:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 11, 9:14 PM
Unknown Object (File)
Mon, Aug 11, 8:59 PM
Unknown Object (File)
Mon, Aug 11, 6:08 AM
Unknown Object (File)
Sun, Aug 10, 8:29 PM
Unknown Object (File)
Sun, Aug 10, 3:27 PM
Unknown Object (File)
Sun, Aug 10, 6:56 AM
Unknown Object (File)
Fri, Aug 8, 6:37 AM
Unknown Object (File)
Tue, Aug 5, 8:00 PM

Details

Summary

When bridge(4) and vlan(4) are both configured on the same physical
interface, bridge handles incoming packets first and needs to shunt
some packets to vlan(4). Right now, that shunt is done if the packet
is destined for the Ethernet address of the member interface it was
received on, and has a vlan tag.

This is not ideal for two reasons:

  • It leaks some of the "special" behaviour of member_ifaddrs=1 even when member_ifaddrs is set to 0.
  • It means the vlan interface only receives locally-destined traffic, so anything that needs to receive other traffic won't work.

Change the behaviour so that if a member interface has a vlan trunk
configured, *all* tagged packets are unconditionally passed back to
ether_input, which will send them to vlan(4).

This somewhat changes the observable behaviour of vlan(4): since
bridge(4) places all member interfaces in promiscuous mode, the
vlan interface will now receive all traffic on that vlan. This
shouldn't break any real-world configurations because it's only
receiving more traffic; any traffic that was previously received
is still received.

Configuring both vlan(4) and bridge(4) on the same interface is
probably not something we want to support long term, but for now
this makes the code cleaner and the user-visible behaviour simpler
and more predictable.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ivy requested review of this revision.Fri, Aug 1, 4:01 PM

this is split out from D51260. as discussed on net@, i think we probably want to disallow this configuration at some point, but for now this is an improvement on the current behaviour.

This revision was not accepted when it landed; it landed in state Needs Review.Tue, Aug 5, 7:26 PM
This revision was automatically updated to reflect the committed changes.