1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

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.
This commit is contained in:
Andrew Thompson 2006-11-02 08:44:19 +00:00
parent cd281f6d40
commit 2efdffee15
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=163904

View File

@ -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.