diff options
author | thompsa <thompsa@FreeBSD.org> | 2006-11-02 08:44:19 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2006-11-02 08:44:19 +0000 |
commit | 5923722282c735f9656cc3a77fa514476bcd62d8 (patch) | |
tree | 2b7c1065ff3d2a3a4f801acbc968dbad66ceb604 /sys/net | |
parent | 453ab8d5471212ae7b16bd4807ad2e6e18bdbb03 (diff) | |
download | FreeBSD-src-5923722282c735f9656cc3a77fa514476bcd62d8.zip FreeBSD-src-5923722282c735f9656cc3a77fa514476bcd62d8.tar.gz |
Do not test all the conditions if the port is already forwarding. Also print a
debug message if the port is agreed as it is an important condition of the
protocol.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/bridgestp.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index fad42ab..2f63bb3 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -988,10 +988,11 @@ bstp_update_roles(struct bstp_state *bs, struct bstp_port *bp) DPRINTF("%s -> ROOT_PROPOSED\n", bp->bp_ifp->if_xname); } - if (bp->bp_forward_delay_timer.active == 0 || + if (bp->bp_state != BSTP_IFSTATE_FORWARDING && + (bp->bp_forward_delay_timer.active == 0 || (bstp_rerooted(bs, bp) && bp->bp_recent_backup_timer.active == 0 && - bp->bp_protover == BSTP_PROTO_RSTP)) { + bp->bp_protover == BSTP_PROTO_RSTP))) { switch (bp->bp_state) { case BSTP_IFSTATE_DISCARDING: bstp_set_port_state(bp, BSTP_IFSTATE_LEARNING); @@ -1039,10 +1040,13 @@ bstp_update_roles(struct bstp_state *bs, struct bstp_port *bp) bp->bp_ifp->if_xname); } - if ((bp->bp_forward_delay_timer.active == 0 || bp->bp_agreed || + if (bp->bp_state != BSTP_IFSTATE_FORWARDING && + (bp->bp_forward_delay_timer.active == 0 || bp->bp_agreed || bp->bp_operedge) && (bp->bp_recent_root_timer.active == 0 || !bp->bp_reroot) && !bp->bp_sync) { + if (bp->bp_agreed) + DPRINTF("%s -> AGREED\n", bp->bp_ifp->if_xname); /* * If agreed|operedge then go straight to forwarding, * otherwise follow discard -> learn -> forward. |