bugfix: correct the condition of transitioning to seek state.

This commit is contained in:
Gatsby Van
2024-01-05 16:13:58 +08:00
parent 1909df3b9c
commit 22a3a7ad57
+2 -3
View File
@@ -1043,13 +1043,12 @@ int32_t MgmtNet_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
L2_EVENT stateEvent = { L2_EVENT stateEvent = {
.event = L2_EV_MAIN_STATE_UPDATE, .event = L2_EV_MAIN_STATE_UPDATE,
.msg = &newState}; .msg = &newState};
if (L2_GetNodeListLen(instPtr->nodeList) < instPtr->config.netScale && L2_GetMainState(instPtr) != L2_INTRA_SEEK_STATE) if (L2_GetNodeListLen(instPtr->nodeList) < instPtr->config.netScale - 1)
{ {
newState = L2_INTRA_SEEK_STATE; newState = L2_INTRA_SEEK_STATE;
AssertL2Event(instPtr, &stateEvent); AssertL2Event(instPtr, &stateEvent);
} }
else if (L2_GetNodeListLen(instPtr->nodeList) >= instPtr->config.netScale && else
L2_GetMainState(instPtr) != L2_NORMAL_STATE)
{ {
newState = L2_NORMAL_STATE; newState = L2_NORMAL_STATE;
AssertL2Event(instPtr, &stateEvent); AssertL2Event(instPtr, &stateEvent);