diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-11-09 05:46:36 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-11-09 05:46:36 -0800 |
commit | 431ce6b171a05cd17784a86ea2da1dfbf2f37ea0 (patch) | |
tree | d7b7a2adadf0c8ce248a371a8ae27b38beae97db /server/peer.go | |
parent | efcbc131df3aaee82eecc659cdf3428b9f5fe81b (diff) |
server: move ProcessMessage to fsm from peer
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/peer.go')
-rw-r--r-- | server/peer.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/server/peer.go b/server/peer.go index 82c61ae9..3009c73e 100644 --- a/server/peer.go +++ b/server/peer.go @@ -133,7 +133,8 @@ func open2Cap(open *bgp.BGPOpen, n *config.Neighbor) (map[bgp.BGPCapabilityCode] return capMap, rfMap } -func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) ([]*table.Path, bool, []*bgp.BGPMessage) { +func (peer *Peer) handleBGPmessage(e *fsmMsg) ([]*table.Path, bool, []*bgp.BGPMessage) { + m := e.MsgData.(*bgp.BGPMessage) bgpMsgList := []*bgp.BGPMessage{} pathList := []*table.Path{} log.WithFields(log.Fields{ @@ -193,10 +194,8 @@ func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) ([]*table.Path, bool, []*b case bgp.BGP_MSG_UPDATE: update = true peer.conf.Timers.TimersState.UpdateRecvTime = time.Now().Unix() - body := m.Body.(*bgp.BGPUpdate) - table.UpdatePathAttrs4ByteAs(body) - pathList = table.ProcessMessage(m, peer.fsm.peerInfo) - if len(pathList) > 0 { + if len(e.PathList) > 0 { + pathList = e.PathList peer.staleAccepted = true peer.ApplyPolicy(table.POLICY_DIRECTION_IN, pathList) peer.adjRib.UpdateIn(pathList) |