diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-05-15 13:18:50 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-05-22 12:10:07 +0900 |
commit | d2840e6760b0a2576b9f4cab7bca0a1d10d8b84d (patch) | |
tree | b6266fb409b9b5dde1ce4d209bd34c67f90660c8 /server/bmp.go | |
parent | ea56b24395b29025c0ad4ce2fac10be9b6c8895b (diff) |
bmp: Fix peer header info in Loc-RIB route message
"draft-evens-grow-bmp-local-rib" says the peer header for Loc-RIB
monitoring should include the following values;
- Peer Address: Zero-filled as remote peer address is not applicable.
- Peer AS: Set to the BGP instance global or default ASN value.
- Peer BGP ID: Set to the BGP instance global or RD (e.g. VRF) specific
router-id.
This patch fixes the peer header construction to follow this
specification.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'server/bmp.go')
-rw-r--r-- | server/bmp.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/bmp.go b/server/bmp.go index 30efaeb1..8d996cd3 100644 --- a/server/bmp.go +++ b/server/bmp.go @@ -167,11 +167,16 @@ func (b *bmpClient) loop() { } } case *WatchEventBestPath: + info := &table.PeerInfo{ + Address: net.ParseIP("0.0.0.0").To4(), + AS: b.s.bgpConfig.Global.Config.As, + ID: net.ParseIP(b.s.bgpConfig.Global.Config.RouterId).To4(), + } for _, p := range msg.PathList { u := table.CreateUpdateMsgFromPaths([]*table.Path{p})[0] if payload, err := u.Serialize(); err != nil { return false - } else if err = write(bmpPeerRoute(bmp.BMP_PEER_TYPE_LOCAL_RIB, false, 0, p.GetSource(), p.GetTimestamp().Unix(), payload)); err != nil { + } else if err = write(bmpPeerRoute(bmp.BMP_PEER_TYPE_LOCAL_RIB, false, 0, info, p.GetTimestamp().Unix(), payload)); err != nil { return false } } |