summaryrefslogtreecommitdiffhomepage
path: root/server/server.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-11-13 13:05:24 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-11-13 13:05:24 +0900
commit072a0b07bd151a49d1dcdec7a1bb224ff3cdae38 (patch)
tree83a9ea68816a4b5cd40770c59ae2cf0e5475597a /server/server.go
parent12ae1b784d400103623aca5554382e84d9843a28 (diff)
bmp: use on-wire original update data
bgpd parse on-wire original update data to construct BGPMessage object and serialize it. Sometimes the both data is not idential. For example, the original data sets the extended length for attribute even if the length is less than 256. This commit fixes the above issue. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r--server/server.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/server.go b/server/server.go
index ecdbc8c2..3e7d4072 100644
--- a/server/server.go
+++ b/server/server.go
@@ -333,7 +333,8 @@ func (server *BgpServer) Serve() {
for _, p := range targetPeer.adjRib.GetInPathList(targetPeer.configuredRFlist()) {
// avoid to merge for timestamp
u := table.CreateUpdateMsgFromPaths([]*table.Path{p})
- bmpMsgList = append(bmpMsgList, bmpPeerRoute(bgp.BMP_PEER_TYPE_GLOBAL, false, 0, targetPeer.fsm.peerInfo, p.GetTimestamp().Unix(), u[0]))
+ buf, _ := u[0].Serialize()
+ bmpMsgList = append(bmpMsgList, bmpPeerRoute(bgp.BMP_PEER_TYPE_GLOBAL, false, 0, targetPeer.fsm.peerInfo, p.GetTimestamp().Unix(), buf))
}
}
@@ -815,7 +816,7 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg, incoming chan *
if ch := server.bmpClient.send(); ch != nil {
bm := &broadcastBMPMsg{
ch: ch,
- msgList: []*bgp.BMPMessage{bmpPeerRoute(bgp.BMP_PEER_TYPE_GLOBAL, false, 0, peer.fsm.peerInfo, e.timestamp.Unix(), m)},
+ msgList: []*bgp.BMPMessage{bmpPeerRoute(bgp.BMP_PEER_TYPE_GLOBAL, false, 0, peer.fsm.peerInfo, e.timestamp.Unix(), e.payload)},
}
server.broadcastMsgs = append(server.broadcastMsgs, bm)
}