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.