Skip to content

Commit

Permalink
Make sure LTime is set even if the BMP station didn't set it
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Wilhelm <[email protected]>
  • Loading branch information
Maximilian Wilhelm authored and BarbarossaTM committed Sep 21, 2022
1 parent bc75cd4 commit 19a0bae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion protocols/bgp/server/bmp_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 19a0bae

Please sign in to comment.