summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/peer.go2
-rw-r--r--server/server.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/server/peer.go b/server/peer.go
index ef08a4d8..b8bc9bcb 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -56,7 +56,7 @@ func NewPeer(g config.Global, conf config.Neighbor, loc *table.TableManager, pol
tableId = conf.Config.NeighborAddress
}
peer.tableId = tableId
- conf.State.SessionState = uint32(bgp.BGP_FSM_IDLE)
+ conf.State.SessionState = conf.State.SessionState.FromInt(int(bgp.BGP_FSM_IDLE))
conf.Timers.State.Downtime = time.Now().Unix()
rfs, _ := config.AfiSafis(conf.AfiSafis).ToRfList()
peer.adjRibIn = table.NewAdjRib(peer.ID(), rfs)
diff --git a/server/server.go b/server/server.go
index 3471ee7e..3a3b70fe 100644
--- a/server/server.go
+++ b/server/server.go
@@ -910,8 +910,8 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg) []*SenderMsg {
switch e.MsgType {
case FSM_MSG_STATE_CHANGE:
nextState := e.MsgData.(bgp.FSMState)
- oldState := bgp.FSMState(peer.conf.State.SessionState)
- peer.conf.State.SessionState = uint32(nextState)
+ oldState := bgp.FSMState(peer.conf.State.SessionState.ToInt())
+ peer.conf.State.SessionState = peer.conf.State.SessionState.FromInt(int(nextState))
peer.fsm.StateChange(nextState)
if oldState == bgp.BGP_FSM_ESTABLISHED {