adigostin/mstp-lib

Restarting the state machines not always correct

adigostin opened this issue · 0 comments

When BEGIN is asserted, for example due to changing the protocol version with STP_SetStpVersion(), each state machine must enter a well-defined state and execute the "state entry" code.

Bug: if a state machine is already in that state when BEGIN is asserted, then the "state entry" code is not executed. See this comment in various state machines: // The entry block for this state has been executed already.

Fix: In RestartStateMachines(), force the state of all state machines to "undefined" (value 0) after asserting BEGIN and before running the state machines. This will cause them to always transition to the well-defined state and execute its entry code.