assign(ptp->portPriority, tree->BridgePriority);
assign(ptp->portTimes, tree->BridgeTimes);
+ ptp->calledFromFlushRoutine = false;
+
/* The following are initialized in BEGIN state:
* - rcvdMsg: in Port Receive SM
* - fdWhile, rrWhile, rbWhile, role, learn, forward,
void MSTP_IN_all_fids_flushed(per_tree_port_t *ptp)
{
bridge_t *br = ptp->port->bridge;
+ ptp->fdbFlush = false;
if(!br->bridgeEnabled)
return;
- ptp->fdbFlush = false;
- TCSM_run(ptp);
- br_state_machines_run(br);
+ if(!ptp->calledFromFlushRoutine)
+ {
+ TCSM_run(ptp);
+ br_state_machines_run(br);
+ }
}
/* NOTE: bpdu pointer is unaligned, but it works because
if(rstpVersion(br))
{
ptp->fdbFlush = true;
+ ptp->calledFromFlushRoutine = true;
MSTP_OUT_flush_all_fids(ptp);
+ ptp->calledFromFlushRoutine = false;
}
else
{
PSTSM_states_t PSTSM_state;
TCSM_states_t TCSM_state;
+ /* Auxiliary flag, helps preventing infinite recursion */
+ bool calledFromFlushRoutine;
+
/* Pointer to the corresponding MSTI Configuration Message
* in the port->rcvdBpduData */
msti_configuration_message_t *rcvdMstiConfig;