Page MenuHomeFreeBSD

bridge: do not allow a bridge SVI in a bridge
ClosedPublic

Authored by ivy on Jul 14 2025, 4:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 6:49 AM
Unknown Object (File)
Sat, Oct 11, 6:49 AM
Unknown Object (File)
Sat, Oct 11, 6:49 AM
Unknown Object (File)
Sat, Oct 11, 6:49 AM
Unknown Object (File)
Fri, Oct 10, 11:33 PM
Unknown Object (File)
Sun, Oct 5, 12:20 AM
Unknown Object (File)
Sat, Oct 4, 4:08 AM
Unknown Object (File)
Thu, Oct 2, 4:01 AM

Details

Summary

Disallow this:

ifconfig bridge0 create
ifconfig bridge0.1 create
ifconfig bridge0 addm bridge0.1

Also disallow this:

ifconfig vlan1 create
ifconfig bridge0 create
ifconfig bridge0 addm vlan1
ifconfig vlan1 vlan 1 vlandev bridge0

Firstly, this panics due to trying to take BRIDGE_LOCK recursively.
Secondly, even if it worked, it could cause packet forwarding loops.

Diff Detail

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

Event Timeline

ivy requested review of this revision.Jul 14 2025, 4:42 PM
tests/sys/net/if_bridge_test.sh
1249

Why two separate tests if you can't even think of separate names and descriptions for them?

tests/sys/net/if_bridge_test.sh
1249

because they test different things: one is testing if_bridge, the other is testing if_vlan. it's less confusing to work out what's broken if they're separate tests.

tests/sys/net/if_bridge_test.sh
1249

If the second test case tests if_vlan.c, it belongs in if_vlan.sh.

move the vlan test to if_vlan_test

rebased on main (for quicker committing) so this is no longer part of the bridge stack.

This revision is now accepted and ready to land.Jul 28 2025, 5:36 PM
This revision was automatically updated to reflect the committed changes.