summaryrefslogtreecommitdiffhomepage
path: root/pkg/server
diff options
context:
space:
mode:
authorEiichiro Watanabe <a16tochjp@gmail.com>2018-12-30 08:49:05 +0900
committerEiichiro Watanabe <a16tochjp@gmail.com>2018-12-30 08:49:05 +0900
commit67947eeda62ff961208b19f29c652399dd93ea97 (patch)
tree501e5a00fc4fad1b32b109ad2fef130d10a61922 /pkg/server
parentbbc85d46c345f6ee2f70f06fc80bba9c8c6e689c (diff)
Fix incorrect values in BMP Statistics Report(type 7 and 8)
Diffstat (limited to 'pkg/server')
-rw-r--r--pkg/server/bmp.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/server/bmp.go b/pkg/server/bmp.go
index 67ed3a91..063574c0 100644
--- a/pkg/server/bmp.go
+++ b/pkg/server/bmp.go
@@ -298,14 +298,17 @@ func bmpPeerRoute(t uint8, policy bool, pd uint64, fourBytesAs bool, peeri *tabl
func bmpPeerStats(peerType uint8, peerDist uint64, timestamp int64, peer *api.Peer) *bmp.BMPMessage {
var peerFlags uint8 = 0
ph := bmp.NewBMPPeerHeader(peerType, peerFlags, peerDist, peer.State.NeighborAddress, peer.State.PeerAs, peer.State.RouterId, float64(timestamp))
+ received := uint64(0)
accepted := uint64(0)
for _, a := range peer.AfiSafis {
+ received += a.State.Received
accepted += a.State.Accepted
}
return bmp.NewBMPStatisticsReport(
*ph,
[]bmp.BMPStatsTLVInterface{
- bmp.NewBMPStatsTLV64(bmp.BMP_STAT_TYPE_ADJ_RIB_IN, accepted),
+ bmp.NewBMPStatsTLV64(bmp.BMP_STAT_TYPE_ADJ_RIB_IN, received),
+ bmp.NewBMPStatsTLV64(bmp.BMP_STAT_TYPE_LOC_RIB, accepted),
bmp.NewBMPStatsTLV32(bmp.BMP_STAT_TYPE_WITHDRAW_UPDATE, uint32(peer.State.Messages.Received.WithdrawUpdate)),
bmp.NewBMPStatsTLV32(bmp.BMP_STAT_TYPE_WITHDRAW_PREFIX, uint32(peer.State.Messages.Received.WithdrawPrefix)),
},