diff --git a/protocols/bgp/server/bmp_router.go b/protocols/bgp/server/bmp_router.go index c6928b03..f73f41af 100644 --- a/protocols/bgp/server/bmp_router.go +++ b/protocols/bgp/server/bmp_router.go @@ -210,6 +210,10 @@ func (r *Router) processMsg(msg []byte) { func (r *Router) processRouteMonitoringMsg(msg *bmppkt.RouteMonitoringMsg) { atomic.AddUint64(&r.counters.routeMonitoringMessages, 1) + if !msg.PerPeerHeader.GetLFlag() { // we're only interested in post-policy routes + return + } + n := r.neighborManager.getNeighbor(msg.PerPeerHeader.PeerDistinguisher, msg.PerPeerHeader.PeerAddress) if n == nil { log.Errorf("Received route monitoring message for non-existent neighbor %d/%v on %s", msg.PerPeerHeader.PeerDistinguisher, msg.PerPeerHeader.PeerAddress, r.address.String()) diff --git a/protocols/bgp/server/bmp_server_test.go b/protocols/bgp/server/bmp_server_test.go index f26e77a5..7c6e4aaf 100644 --- a/protocols/bgp/server/bmp_server_test.go +++ b/protocols/bgp/server/bmp_server_test.go @@ -227,7 +227,7 @@ func TestBMPServer(t *testing.T) { 0, // Msg Type (route monitoring) 0, // Peer Type (global instance peer) - 0b00100000, // Peer Flags + 0b01100000, // Peer Flags 0, 0, 0, 0, 0, 0, 0, 123, // Peer Distinguisher 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 1, 1, 1, // Peer Address (10.1.1.1) 0, 0, 0, 200, // Peer AS = 200 @@ -318,7 +318,7 @@ func TestBMPServer(t *testing.T) { 0, // Msg Type (route monitoring) 0, // Peer Type (global instance peer) - 0b00100000, // Peer Flags + 0b01100000, // Peer Flags 0, 0, 0, 0, 0, 0, 0, 123, // Peer Distinguisher 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 1, 2, 1, // Peer Address (10.1.2.1) 0, 0, 0, 222, // Peer AS = 222