]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Use bgp_dest_get_prefix accessor function
authorDonald Sharp <sharpd@nvidia.com>
Wed, 14 Oct 2020 15:39:27 +0000 (11:39 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Sat, 17 Oct 2020 12:52:35 +0000 (08:52 -0400)
Use the appropriate bgp_dest_get_prefix accessor function

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_evpn.c
bgpd/bgp_evpn_mh.c

index da2be7383e1ae45535950cfa034760732bdbde53..ac8332967eed0268ef4c809c2ef60ede0214ea4e 100644 (file)
@@ -1035,7 +1035,8 @@ static void evpn_delete_old_local_route(struct bgp *bgp, struct bgpevpn *vpn,
                char prefix_buf[PREFIX_STRLEN];
                char esi_buf[ESI_STR_LEN];
                char esi_buf2[ESI_STR_LEN];
-               struct prefix_evpn *evp = (struct prefix_evpn *)&dest->p;
+               struct prefix_evpn *evp =
+                       (struct prefix_evpn *)bgp_dest_get_prefix(dest);
 
                zlog_debug("local path deleted %s es %s; new-path-es %s",
                                prefix2str(evp,
@@ -1426,7 +1427,8 @@ static void update_evpn_route_entry_sync_info(struct bgp *bgp,
                                              uint32_t loc_seq, bool setup_sync)
 {
        esi_t *esi;
-       struct prefix_evpn *evp = (struct prefix_evpn *)&dest->p;
+       struct prefix_evpn *evp =
+               (struct prefix_evpn *)bgp_dest_get_prefix(dest);
 
        if (evp->prefix.route_type != BGP_EVPN_MAC_IP_ROUTE)
                return;
@@ -1953,7 +1955,8 @@ static void bgp_evpn_update_type2_route_entry(struct bgp *bgp,
        int add_l3_ecomm = 0;
        struct bgp_dest *global_dest;
        struct bgp_path_info *global_pi;
-       struct prefix_evpn *evp = (struct prefix_evpn *)&dest->p;
+       struct prefix_evpn *evp =
+               (struct prefix_evpn *)bgp_dest_get_prefix(dest);
        int route_change;
        bool old_is_sync = false;
 
index b5c13de416e36ef55ff3e01147808ae1dd11100c..6fb5a44208b6ffae101901ae28c9912a190b41f0 100644 (file)
@@ -340,7 +340,7 @@ static int bgp_evpn_mh_route_update(struct bgp *bgp, struct bgp_evpn_es *es,
        struct prefix_evpn *evp;
 
        *ri = NULL;
-       evp = (struct prefix_evpn *)&dest->p;
+       evp = (struct prefix_evpn *)bgp_dest_get_prefix(dest);
        *route_changed = 1;
 
        /* locate the local and remote entries if any */
@@ -717,7 +717,7 @@ static int bgp_evpn_type4_remote_routes_import(struct bgp *bgp,
                for (dest = bgp_table_top(table); dest;
                     dest = bgp_route_next(dest)) {
                        struct prefix_evpn *evp =
-                               (struct prefix_evpn *)&dest->p;
+                               (struct prefix_evpn *)bgp_dest_get_prefix(dest);
 
                        for (pi = bgp_dest_get_bgp_path_info(dest); pi;
                             pi = pi->next) {