summaryrefslogtreecommitdiffstats
path: root/sys/net/bridgestp.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2007-08-18 12:06:13 +0000
committerthompsa <thompsa@FreeBSD.org>2007-08-18 12:06:13 +0000
commitc58bdad9f2ec03ff531566782125fee5182ff68f (patch)
treeb72824c43f0b9a4e909e3b88937a836838903dbd /sys/net/bridgestp.c
parent093e149434fed9c6690336caca829b093bdc4309 (diff)
downloadFreeBSD-src-c58bdad9f2ec03ff531566782125fee5182ff68f.zip
FreeBSD-src-c58bdad9f2ec03ff531566782125fee5182ff68f.tar.gz
If the STP state machine is stopped then clear the bridge-id and root-id.
Approved by: re (kensmith)
Diffstat (limited to 'sys/net/bridgestp.c')
-rw-r--r--sys/net/bridgestp.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c
index dcb258f..d270939 100644
--- a/sys/net/bridgestp.c
+++ b/sys/net/bridgestp.c
@@ -1688,7 +1688,8 @@ bstp_set_autoptp(struct bstp_port *bp, int set)
BSTP_LOCK(bs);
if (set) {
bp->bp_flags |= BSTP_PORT_AUTOPTP;
- bstp_ifupdstatus(bs, bp);
+ if (bp->bp_role != BSTP_ROLE_DISABLED)
+ bstp_ifupdstatus(bs, bp);
} else
bp->bp_flags &= ~BSTP_PORT_AUTOPTP;
BSTP_UNLOCK(bs);
@@ -2022,11 +2023,6 @@ bstp_reinit(struct bstp_state *bs)
BSTP_LOCK_ASSERT(bs);
- if (LIST_EMPTY(&bs->bs_bplist)) {
- callout_stop(&bs->bs_bstpcallout);
- return;
- }
-
mif = NULL;
/*
* Search through the Ethernet adapters and find the one with the
@@ -2053,8 +2049,17 @@ bstp_reinit(struct bstp_state *bs)
}
IFNET_RUNLOCK();
- /* Can only happen if all interfaces have a zero MAC address */
- if (mif == NULL) {
+ if (LIST_EMPTY(&bs->bs_bplist) || mif == NULL) {
+ /* Set the bridge and root id (lower bits) to zero */
+ bs->bs_bridge_pv.pv_dbridge_id =
+ ((uint64_t)bs->bs_bridge_priority) << 48;
+ bs->bs_bridge_pv.pv_root_id = bs->bs_bridge_pv.pv_dbridge_id;
+ bs->bs_root_pv = bs->bs_bridge_pv;
+ /* Disable any remaining ports, they will have no MAC address */
+ LIST_FOREACH(bp, &bs->bs_bplist, bp_next) {
+ bp->bp_infois = BSTP_INFO_DISABLED;
+ bstp_set_port_role(bp, BSTP_ROLE_DISABLED);
+ }
callout_stop(&bs->bs_bstpcallout);
return;
}
OpenPOWER on IntegriCloud