bgpd: Use bgp_dest_get_prefix accessor function

Use the appropriate bgp_dest_get_prefix accessor function

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2020-10-14 11:39:27 -04:00
parent 09319b4e0f
commit 752eed47ef
2 changed files with 8 additions and 5 deletions

View File

@ -1035,7 +1035,8 @@ static void evpn_delete_old_local_route(struct bgp *bgp, struct bgpevpn *vpn,
char prefix_buf[PREFIX_STRLEN]; char prefix_buf[PREFIX_STRLEN];
char esi_buf[ESI_STR_LEN]; char esi_buf[ESI_STR_LEN];
char esi_buf2[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", zlog_debug("local path deleted %s es %s; new-path-es %s",
prefix2str(evp, prefix2str(evp,
@ -1426,7 +1427,8 @@ static void update_evpn_route_entry_sync_info(struct bgp *bgp,
uint32_t loc_seq, bool setup_sync) uint32_t loc_seq, bool setup_sync)
{ {
esi_t *esi; 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) if (evp->prefix.route_type != BGP_EVPN_MAC_IP_ROUTE)
return; return;
@ -1953,7 +1955,8 @@ static void bgp_evpn_update_type2_route_entry(struct bgp *bgp,
int add_l3_ecomm = 0; int add_l3_ecomm = 0;
struct bgp_dest *global_dest; struct bgp_dest *global_dest;
struct bgp_path_info *global_pi; 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; int route_change;
bool old_is_sync = false; bool old_is_sync = false;

View File

@ -340,7 +340,7 @@ static int bgp_evpn_mh_route_update(struct bgp *bgp, struct bgp_evpn_es *es,
struct prefix_evpn *evp; struct prefix_evpn *evp;
*ri = NULL; *ri = NULL;
evp = (struct prefix_evpn *)&dest->p; evp = (struct prefix_evpn *)bgp_dest_get_prefix(dest);
*route_changed = 1; *route_changed = 1;
/* locate the local and remote entries if any */ /* 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; for (dest = bgp_table_top(table); dest;
dest = bgp_route_next(dest)) { dest = bgp_route_next(dest)) {
struct prefix_evpn *evp = 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; for (pi = bgp_dest_get_bgp_path_info(dest); pi;
pi = pi->next) { pi = pi->next) {