diff --git a/protocols/bgp/server/bmp_router.go b/protocols/bgp/server/bmp_router.go index 37f31154..0af53ab8 100644 --- a/protocols/bgp/server/bmp_router.go +++ b/protocols/bgp/server/bmp_router.go @@ -248,7 +248,13 @@ func (r *Router) processRouteMonitoringMsg(msg *bmppkt.RouteMonitoringMsg) { opt := s.fsm.decodeOptions() opt.Use32BitASN = !msg.PerPeerHeader.GetAFlag() - s.msgReceived(msg.BGPUpdate, opt, msg.PerPeerHeader.GetLFlag(), msg.PerPeerHeader.Timestamp) + // Make sure timestamp is set even if the router didn't set it + ts := msg.PerPeerHeader.Timestamp + if ts == 0 { + ts = uint32(time.Now().Unix()) + } + + s.msgReceived(msg.BGPUpdate, opt, msg.PerPeerHeader.GetLFlag(), ts) } func (r *Router) processInitiationMsg(msg *bmppkt.InitiationMessage) {