diff options
Diffstat (limited to 'server/fsm.go')
-rw-r--r-- | server/fsm.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/fsm.go b/server/fsm.go index 2de18cd9..7469f47e 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -53,9 +53,14 @@ func (fsm *FSM) StateChanged() chan int { return fsm.stateCh } -func (fsm *FSM) StateSet(nextState int) { +func (fsm *FSM) StateChange(nextState int) bool { fmt.Println("state changed", nextState, fsm.state) + oldState := fsm.state fsm.state = nextState + if oldState >= bgp.BGP_FSM_OPENSENT && fsm.state == bgp.BGP_FSM_IDLE { + return true + } + return false } type FSMHandler struct { |