summaryrefslogtreecommitdiffhomepage
path: root/server/fsm.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-17 09:25:34 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-17 09:25:34 +0900
commit5305b68266b5fe81fdd390448e775936c57d93ef (patch)
tree731083991e7bd6c62d522e02b960497ae19ff66b /server/fsm.go
parent5dddfe65e94deb55c1dcb4dfab1ea48390771168 (diff)
server: keep source version number
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/fsm.go')
-rw-r--r--server/fsm.go7
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 {