Skip to content

stp: block a held port again when the loop returns while it learns - #1010

Open
DrDoof wants to merge 1 commit into
RTLPlayground:mainfrom
DrDoof:fix/stp-loop-hold-learning
Open

DrDoof wants to merge 1 commit into
RTLPlayground:mainfrom
DrDoof:fix/stp-loop-hold-learning

Conversation

@DrDoof

@DrDoof DrDoof commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

A port held for a detected loop can end up in learning for good. stp_loop_hold_peer() set the port to discarding only when its timer wasn't running. If the returned BPDUs stop for longer than the forward delay, say because the cable was out for 20 seconds, the port moves on to learning; when they come back only the timer is renewed. The port then stays in learning as long as the loop lasts and learns addresses on a segment it doesn't forward to.

The port is now put back to discarding whenever it is held.

The STP simulator has a scenario for it: a returned frame while the held port is learning takes it back to discarding. It fails on main and passes with this change.

A port held for a detected loop was set to discarding only when its
timer was not running. When the returned BPDUs stopped for longer than
the forward delay the port moved on to learning, and when they came
back only the timer was renewed: the port stayed in learning for as
long as the loop lasted, learning addresses on a segment it does not
forward to.

Put the port back to discarding whenever it is held.
@DrDoof DrDoof added bugfix UI/JS Issues relating to the webUI labels Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix UI/JS Issues relating to the webUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant