HomeFreeBSD

bridge: Fix panic if the STP root is removed

Description

bridge: Fix panic if the STP root is removed

If the spanning tree root interface is removed from the bridge we panic
on the next 'ifconfig'.
While the STP code is notified whenever a bridge member interface is
removed from the bridge it does not clear the bs_root_port. This means
bs_root_port can still point at an bridge_iflist which has been free()d.
The next access to it will panic.

Explicitly check if the interface we're removing in bstp_destroy() is
the root, and if so re-assign the roles, which clears bs_root_port.

Reviewed by: philip
MFC after: 2 weeks

Details

Provenance
kpAuthored on
Reviewer
philip
Parents
rS345177: pf :Use counter(9) in pf tables.
Branches
Unknown
Tags
Unknown