Skip to content

Commit 5193940

Browse files
committed
server/fsm: update fsm state after updating related information
Before updating fsm state to establish, we have to set up fsm.peerInfo, etc. Signed-off-by: FUJITA Tomonori <[email protected]>
1 parent 27f0355 commit 5193940

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/server/fsm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ func (fsm *fsm) stateChange(nextState bgp.FSMState, reason *fsmStateReason) {
539539
slog.String("new", nextState.String()),
540540
slog.String("reason", reason.String()))
541541

542-
fsm.state.Store(nextState)
543542
switch nextState {
544543
case bgp.BGP_FSM_ESTABLISHED:
545544
remoteTCP := fsm.conn.RemoteAddr().(*net.TCPAddr)
@@ -1988,6 +1987,7 @@ func (h *fsmHandler) loop(ctx context.Context, wg *sync.WaitGroup) {
19881987
}
19891988

19901989
h.callback(msg)
1990+
fsm.state.Store(nextState)
19911991
oldState = nextState
19921992
}
19931993

0 commit comments

Comments
 (0)