diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index d7ee2aa19f..4953032f97 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -3325,12 +3325,18 @@ static void bgp_route_map_process_update(struct bgp *bgp, const char *rmap_name, != 0) continue; + /* Make sure the route-map is populated here if not already done */ + bgp->adv_cmd_rmap[afi][safi].map = map; + if (BGP_DEBUG(zebra, ZEBRA)) zlog_debug( "Processing route_map %s update on advertise type5 route command", rmap_name); - bgp_evpn_withdraw_type5_routes(bgp, afi, safi); - bgp_evpn_advertise_type5_routes(bgp, afi, safi); + + if (route_update) { + bgp_evpn_withdraw_type5_routes(bgp, afi, safi); + bgp_evpn_advertise_type5_routes(bgp, afi, safi); + } } }