]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix missing rmac value in debug 11568/head
authoranlan_cs <vic.lan@pica8.com>
Fri, 8 Jul 2022 04:09:56 +0000 (00:09 -0400)
committeranlan_cs <vic.lan@pica8.com>
Fri, 8 Jul 2022 04:27:00 +0000 (00:27 -0400)
`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 <vic.lan@pica8.com>
bgpd/bgp_evpn.c

index 3483ece5b8aac4c2cc63cfa227f0c22119c9c28d..bbbe538acc9bf6197411b30dcef2af56d7e23b88 100644 (file)
@@ -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));