Page MenuHomeFreeBSD

if_bridge: add MDB foundation
Needs ReviewPublic

Authored by namkhanh052005_gmail.com on Sat, Jun 13, 8:39 AM.

Details

Reviewers
bms
Summary

This patch adds the internal multicast database (MDB) foundation to if_bridge(4).

It is intended to be behavior neutral. It does not parse IGMP or MLD, does not change bridge forwarding decisions, does not add ioctls, and does not add user visible ifconfig commands.

The patch adds:

  • bridge_mdb_key, identifying an MDB group by address family, VLAN ID, and IPv4 or IPv6 multicast address
  • bridge_mdb_entry, representing one multicast group in the bridge MDB
  • bridge_mdb_member, representing one bridge member interface with listeners for an MDB group
  • MDB state in bridge_softc: sc_mdb, sc_mdbcnt, and sc_mdbmembercnt
  • bridge_mdb_init() during bridge creation
  • bridge_mdb_fini() during bridge destruction
  • bridge_mdb_destroy_entry() to release all members in one MDB entry
  • lock documentation noting MDB state is protected by BRIDGE_RT_LOCK

This is the first patch in a planned bridge IGMP/MLD snooping series.

Test Plan

git diff --check

No whitespace errors were reported.

Functional scope:

This review only adds internal MDB data structures and bridge create/destroy
lifecycle cleanup in sys/net/if_bridge.c.

It does not add IGMP/MLD packet parsing, MDB aware multicast forwarding, ioctls,
ifconfig commands, sysctls, or ATF tests. No user visible behavior change is
expected from this review alone.

Runtime functionality was checked by creating and destroying bridge interfaces
with the patched kernel to exercise the MDB init/fini paths.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 73849
Build 70732: arc lint + arc unit