diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-09 18:10:22 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-09 18:10:22 +0900 |
commit | d6d4f24454975a61f88fc48531ffbcd9e6e8fdd7 (patch) | |
tree | 0043c0a91352e5747bd738b19009b40e6a96fa0c | |
parent | 0298d02780d96903a1e350fb07a3dd2c751a1b4c (diff) |
server: fix MessageStateUpdate Usage
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | server/fsm.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/fsm.go b/server/fsm.go index 62fc860e..f3b6c3db 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -225,6 +225,7 @@ func (h *FSMHandler) recvMessageWithError() error { MsgData: m, } h.msgCh <- e + h.fsm.bgpMessageStateUpdate(m.Header.Type, true) return nil } @@ -252,7 +253,6 @@ func (h *FSMHandler) opensent() bgp.FSMState { return 0 case e := <-h.msgCh: m := e.MsgData.(*bgp.BGPMessage) - fsm.bgpMessageStateUpdate(m.Header.Type, true) if m.Header.Type == bgp.BGP_MSG_OPEN { e := &fsmMsg{ MsgType: FSM_MSG_BGP_MESSAGE, @@ -262,8 +262,8 @@ func (h *FSMHandler) opensent() bgp.FSMState { msg := bgp.NewBGPKeepAliveMessage() b, _ := msg.Serialize() fsm.passiveConn.Write(b) - fsm.bgpMessageStateUpdate(m.Header.Type, false) nextState = bgp.BGP_FSM_OPENCONFIRM + fsm.bgpMessageStateUpdate(msg.Header.Type, false) } else { // send error } @@ -292,10 +292,10 @@ func (h *FSMHandler) openconfirm() bgp.FSMState { b, _ := m.Serialize() // TODO: check error fsm.passiveConn.Write(b) + fsm.bgpMessageStateUpdate(m.Header.Type, false) case e := <-h.msgCh: m := e.MsgData.(*bgp.BGPMessage) nextState := bgp.BGP_FSM_IDLE - fsm.bgpMessageStateUpdate(m.Header.Type, true) if m.Header.Type == bgp.BGP_MSG_KEEPALIVE { nextState = bgp.BGP_FSM_ESTABLISHED } else { |