From 2304139a62c667cad734becc43ace87826be397e Mon Sep 17 00:00:00 2001 From: anlan_cs Date: Fri, 8 Jul 2022 00:09:56 -0400 Subject: [PATCH] bgpd: fix missing rmac value in debug `attr.rmac` is not set in debug as expected for its wrong place in code. Just move the debug process (`bgp_debug_zebra(NULL)`) after possible `rmac` value is set. Signed-off-by: anlan_cs --- bgpd/bgp_evpn.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 3483ece5b8..bbbe538acc 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -1753,6 +1753,16 @@ static int update_evpn_route(struct bgp *bgp, struct bgpevpn *vpn, bgp_attr_set_pmsi_tnl_type(&attr, PMSI_TNLTYPE_INGR_REPL); } + /* router mac is only needed for type-2 routes here. */ + if (p->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE) { + uint8_t af_flags = 0; + + if (CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_SVI_IP)) + SET_FLAG(af_flags, BGP_EVPN_MACIP_TYPE_SVI_IP); + + bgp_evpn_get_rmac_nexthop(vpn, p, &attr, af_flags); + } + if (bgp_debug_zebra(NULL)) { char buf3[ESI_STR_LEN]; @@ -1763,15 +1773,6 @@ static int update_evpn_route(struct bgp *bgp, struct bgpevpn *vpn, vpn->vni, p, &attr.rmac, &attr.mp_nexthop_global_in, esi_to_str(esi, buf3, sizeof(buf3))); } - /* router mac is only needed for type-2 routes here. */ - if (p->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE) { - uint8_t af_flags = 0; - - if (CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_SVI_IP)) - SET_FLAG(af_flags, BGP_EVPN_MACIP_TYPE_SVI_IP); - - bgp_evpn_get_rmac_nexthop(vpn, p, &attr, af_flags); - } vni2label(vpn->vni, &(attr.label)); -- 2.39.5