From 43610ebc6c977141b93a185e87fe5c5f8de2553e Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Wed, 6 Jan 2016 13:43:04 +0900 Subject: server: fix storing received open msg Signed-off-by: ISHIDA Wataru --- server/fsm.go | 2 ++ server/peer.go | 1 - server/server.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/fsm.go b/server/fsm.go index 6214d0b1..af635f83 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -86,6 +86,7 @@ type FSM struct { h *FSMHandler rfMap map[bgp.RouteFamily]bool capMap map[bgp.BGPCapabilityCode][]bgp.ParameterCapabilityInterface + recvOpen *bgp.BGPMessage confedCheck bool peerInfo *table.PeerInfo policy *table.RoutingPolicy @@ -626,6 +627,7 @@ func (h *FSMHandler) opensent() bgp.FSMState { case *bgp.BGPMessage: m := e.MsgData.(*bgp.BGPMessage) if m.Header.Type == bgp.BGP_MSG_OPEN { + fsm.recvOpen = m body := m.Body.(*bgp.BGPOpen) err := bgp.ValidateOpenMsg(body, fsm.pConf.Config.PeerAs) if err != nil { diff --git a/server/peer.go b/server/peer.go index 22f98e6c..5f42c73e 100644 --- a/server/peer.go +++ b/server/peer.go @@ -39,7 +39,6 @@ type Peer struct { adjRibIn *table.AdjRib adjRibOut *table.AdjRib outgoing chan *bgp.BGPMessage - recvOpen *bgp.BGPMessage policy *table.RoutingPolicy localRib *table.TableManager } diff --git a/server/server.go b/server/server.go index c18284dd..280f0d8e 100644 --- a/server/server.go +++ b/server/server.go @@ -848,7 +848,7 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg) []*SenderMsg { _, rport := peer.fsm.RemoteHostPort() m := &broadcastBMPMsg{ ch: ch, - msgList: []*bgp.BMPMessage{bmpPeerUp(laddr, lport, rport, buildopen(peer.fsm.gConf, peer.fsm.pConf), peer.recvOpen, bgp.BMP_PEER_TYPE_GLOBAL, false, 0, peer.fsm.peerInfo, peer.conf.Timers.State.Uptime)}, + msgList: []*bgp.BMPMessage{bmpPeerUp(laddr, lport, rport, buildopen(peer.fsm.gConf, peer.fsm.pConf), peer.fsm.recvOpen, bgp.BMP_PEER_TYPE_GLOBAL, false, 0, peer.fsm.peerInfo, peer.conf.Timers.State.Uptime)}, } server.broadcastMsgs = append(server.broadcastMsgs, m) } -- cgit v1.2.3