summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_evpn.c2
-rw-r--r--bgpd/bgp_label.c5
-rw-r--r--bgpd/bgp_mac.c10
-rw-r--r--bgpd/bgp_mplsvpn.c18
-rw-r--r--bgpd/bgp_nht.c12
-rw-r--r--bgpd/bgp_route.c35
-rw-r--r--bgpd/bgp_route.h1
-rw-r--r--bgpd/bgp_routemap.c9
-rw-r--r--bgpd/bgp_rpki.c11
-rw-r--r--bgpd/bgp_updgrp_packet.c7
-rw-r--r--bgpd/bgp_zebra.c13
-rw-r--r--bgpd/rfapi/rfapi_import.c4
-rw-r--r--bgpd/rfapi/rfapi_rib.c2
-rw-r--r--bgpd/rfapi/rfapi_vty.c7
-rw-r--r--bgpd/rfapi/vnc_import_bgp.c21
15 files changed, 77 insertions, 80 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index ce9666d611..ae5d837cbd 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -2986,7 +2986,7 @@ bgp_create_evpn_bgp_path_info(struct bgp_path_info *parent_pi,
if (parent_pi->extra) {
memcpy(&pi->extra->label, &parent_pi->extra->label,
sizeof(pi->extra->label));
- pi->extra->num_labels = parent_pi->extra->num_labels;
+ pi->extra->num_labels = bgp_path_info_num_labels(parent_pi);
pi->extra->igpmetric = parent_pi->extra->igpmetric;
}
diff --git a/bgpd/bgp_label.c b/bgpd/bgp_label.c
index d5732b5677..f57663d7a1 100644
--- a/bgpd/bgp_label.c
+++ b/bgpd/bgp_label.c
@@ -89,9 +89,8 @@ mpls_label_t bgp_adv_label(struct bgp_dest *dest, struct bgp_path_info *pi,
if (!dest || !pi || !to)
return MPLS_INVALID_LABEL;
- remote_label = (pi->extra && pi->extra->num_labels)
- ? pi->extra->label[0]
- : MPLS_INVALID_LABEL;
+ remote_label = bgp_path_info_num_labels(pi) ? pi->extra->label[0]
+ : MPLS_INVALID_LABEL;
from = pi->peer;
reflect =
((from->sort == BGP_PEER_IBGP) && (to->sort == BGP_PEER_IBGP));
diff --git a/bgpd/bgp_mac.c b/bgpd/bgp_mac.c
index e629732c78..aa793e999d 100644
--- a/bgpd/bgp_mac.c
+++ b/bgpd/bgp_mac.c
@@ -125,6 +125,8 @@ static void bgp_process_mac_rescan_table(struct bgp *bgp, struct peer *peer,
{
struct bgp_dest *pdest, *dest;
struct bgp_path_info *pi;
+ uint32_t num_labels;
+ mpls_label_t *label_pnt;
for (pdest = bgp_table_top(table); pdest;
pdest = bgp_route_next(pdest)) {
@@ -140,8 +142,6 @@ static void bgp_process_mac_rescan_table(struct bgp *bgp, struct peer *peer,
const struct prefix *p = bgp_dest_get_prefix(dest);
struct prefix_evpn *pevpn = (struct prefix_evpn *)dest;
struct prefix_rd prd;
- uint32_t num_labels = 0;
- mpls_label_t *label_pnt = NULL;
struct bgp_route_evpn *evpn;
if (pevpn->family == AF_EVPN
@@ -169,10 +169,8 @@ static void bgp_process_mac_rescan_table(struct bgp *bgp, struct peer *peer,
&& !dest_affected)
continue;
- if (pi->extra)
- num_labels = pi->extra->num_labels;
- if (num_labels)
- label_pnt = &pi->extra->label[0];
+ num_labels = bgp_path_info_num_labels(pi);
+ label_pnt = num_labels ? &pi->extra->label[0] : NULL;
prd.family = AF_UNSPEC;
prd.prefixlen = 64;
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
index fb1243d029..6c56b05dff 100644
--- a/bgpd/bgp_mplsvpn.c
+++ b/bgpd/bgp_mplsvpn.c
@@ -2088,7 +2088,7 @@ static void vpn_leak_to_vrf_update_onevrf(struct bgp *to_bgp, /* to */
safi_t safi = SAFI_UNICAST;
const char *debugmsg;
struct prefix nexthop_orig;
- mpls_label_t *pLabels = NULL;
+ mpls_label_t *label_pnt = NULL;
uint32_t num_labels = 0;
int nexthop_self_flag = 1;
struct bgp_path_info *bpi_ultimate = NULL;
@@ -2335,19 +2335,16 @@ static void vpn_leak_to_vrf_update_onevrf(struct bgp *to_bgp, /* to */
origin_local = 1;
}
- /* copy labels */
- if (!origin_local && path_vpn->extra
- && path_vpn->extra->num_labels) {
- num_labels = path_vpn->extra->num_labels;
- pLabels = path_vpn->extra->label;
- }
+ num_labels = origin_local ? 0
+ : bgp_path_info_num_labels(path_vpn);
+ label_pnt = num_labels ? path_vpn->extra->label : NULL;
}
if (debug)
zlog_debug("%s: pfx %pBD: num_labels %d", __func__,
path_vpn->net, num_labels);
- if (!leak_update(to_bgp, bn, new_attr, afi, safi, path_vpn, pLabels,
+ if (!leak_update(to_bgp, bn, new_attr, afi, safi, path_vpn, label_pnt,
num_labels, src_vrf, &nexthop_orig, nexthop_self_flag,
debug))
bgp_dest_unlock_node(bn);
@@ -4223,8 +4220,9 @@ void bgp_mplsvpn_nh_label_bind_register_local_label(struct bgp *bgp,
struct bgp_mplsvpn_nh_label_bind_cache_head *tree;
mpls_label_t label;
- label = pi->extra->num_labels ? decode_label(&pi->extra->label[0])
- : MPLS_INVALID_LABEL;
+ label = bgp_path_info_num_labels(pi)
+ ? decode_label(&pi->extra->label[0])
+ : MPLS_INVALID_LABEL;
tree = &bgp->mplsvpn_nh_label_bind;
bmnc = bgp_mplsvpn_nh_label_bind_find(tree, &pi->nexthop->prefix, label);
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index 79f62ef609..8ce45558e9 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -499,8 +499,8 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop,
if (bgp_route->inst_type == BGP_INSTANCE_TYPE_VIEW)
return 1;
else if (safi == SAFI_UNICAST && pi &&
- pi->sub_type == BGP_ROUTE_IMPORTED && pi->extra &&
- pi->extra->num_labels && !bnc->is_evpn_gwip_nexthop)
+ pi->sub_type == BGP_ROUTE_IMPORTED &&
+ bgp_path_info_num_labels(pi) && !bnc->is_evpn_gwip_nexthop)
return bgp_isvalid_nexthop_for_l3vpn(bnc, pi);
else if (safi == SAFI_MPLS_VPN && pi &&
pi->sub_type != BGP_ROUTE_IMPORTED)
@@ -1301,10 +1301,10 @@ void evaluate_paths(struct bgp_nexthop_cache *bnc)
bool bnc_is_valid_nexthop = false;
bool path_valid = false;
- if (safi == SAFI_UNICAST && path->sub_type == BGP_ROUTE_IMPORTED
- && path->extra && path->extra->num_labels
- && (path->attr->evpn_overlay.type
- != OVERLAY_INDEX_GATEWAY_IP)) {
+ if (safi == SAFI_UNICAST &&
+ path->sub_type == BGP_ROUTE_IMPORTED &&
+ bgp_path_info_num_labels(path) &&
+ (path->attr->evpn_overlay.type != OVERLAY_INDEX_GATEWAY_IP)) {
bnc_is_valid_nexthop =
bgp_isvalid_nexthop_for_l3vpn(bnc, path)
? true
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index ebeaf9a474..5e4c03ae36 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -324,9 +324,7 @@ struct bgp_path_info_extra *bgp_path_info_extra_get(struct bgp_path_info *pi)
bool bgp_path_info_has_valid_label(const struct bgp_path_info *path)
{
- if (!path->extra)
- return false;
- if (!path->extra->num_labels)
+ if (!bgp_path_info_num_labels(path))
return false;
return bgp_is_valid_label(&path->extra->label[0]);
@@ -338,13 +336,24 @@ bool bgp_path_info_labels_same(const struct bgp_path_info *bpi,
uint32_t bpi_num_labels;
const mpls_label_t *bpi_label;
- bpi_num_labels = bpi->extra ? bpi->extra->num_labels : 0;
+ bpi_num_labels = bgp_path_info_num_labels(bpi);
bpi_label = bpi_num_labels ? bpi->extra->label : NULL;
return bgp_labels_same(bpi_label, bpi_num_labels,
(const mpls_label_t *)label, n);
}
+uint32_t bgp_path_info_num_labels(const struct bgp_path_info *pi)
+{
+ if (!pi)
+ return 0;
+
+ if (!pi->extra)
+ return 0;
+
+ return pi->extra->num_labels;
+}
+
/* Free bgp route information. */
void bgp_path_info_free_with_caller(const char *name,
struct bgp_path_info *path)
@@ -2232,8 +2241,8 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
* off box as that the RT and RD created are localy
* significant and globaly useless.
*/
- if (safi == SAFI_MPLS_VPN && pi->extra && pi->extra->num_labels
- && pi->extra->label[0] == BGP_PREVENT_VRF_2_VRF_LEAK)
+ if (safi == SAFI_MPLS_VPN && bgp_path_info_num_labels(pi) &&
+ pi->extra->label[0] == BGP_PREVENT_VRF_2_VRF_LEAK)
return false;
/* If it's labeled safi, make sure the route has a valid label. */
@@ -5659,18 +5668,16 @@ static void bgp_soft_reconfig_table_update(struct peer *peer,
safi_t safi, struct prefix_rd *prd)
{
struct bgp_path_info *pi;
- uint32_t num_labels = 0;
- mpls_label_t *label_pnt = NULL;
+ uint32_t num_labels;
+ mpls_label_t *label_pnt;
struct bgp_route_evpn evpn;
for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next)
if (pi->peer == peer)
break;
- if (pi && pi->extra)
- num_labels = pi->extra->num_labels;
- if (num_labels)
- label_pnt = &pi->extra->label[0];
+ num_labels = bgp_path_info_num_labels(pi);
+ label_pnt = num_labels ? &pi->extra->label[0] : NULL;
if (pi)
memcpy(&evpn, bgp_attr_get_evpn_overlay(pi->attr),
sizeof(evpn));
@@ -6835,7 +6842,7 @@ void bgp_static_update(struct bgp *bgp, const struct prefix *p,
bgp, p, pi);
}
} else {
- if (pi->extra && pi->extra->num_labels)
+ if (bgp_path_info_num_labels(pi))
label = decode_label(
&pi->extra->label[0]);
}
@@ -10506,7 +10513,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
json_nexthop_global = json_object_new_object();
}
- if (path->extra && path->extra->num_labels) {
+ if (bgp_path_info_num_labels(path)) {
bgp_evpn_label2str(path->extra->label, path->extra->num_labels,
vni_buf, sizeof(vni_buf));
}
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h
index 2aa721a3b6..37c5dec758 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -754,6 +754,7 @@ extern void bgp_path_info_delete(struct bgp_dest *dest,
extern struct bgp_path_info_extra *
bgp_path_info_extra_get(struct bgp_path_info *path);
extern bool bgp_path_info_has_valid_label(const struct bgp_path_info *path);
+extern uint32_t bgp_path_info_num_labels(const struct bgp_path_info *pi);
extern void bgp_path_info_set_flag(struct bgp_dest *dest,
struct bgp_path_info *path, uint32_t flag);
extern void bgp_path_info_unset_flag(struct bgp_dest *dest,
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index dc26a1f5dd..8dbe705aa5 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -1056,7 +1056,7 @@ static enum route_map_cmd_result_t
route_match_vni(void *rule, const struct prefix *prefix, void *object)
{
vni_t vni = 0;
- unsigned int label_cnt = 0;
+ unsigned int label_cnt;
struct bgp_path_info *path = NULL;
struct prefix_evpn *evp = (struct prefix_evpn *) prefix;
@@ -1081,11 +1081,8 @@ route_match_vni(void *rule, const struct prefix *prefix, void *object)
&& evp->prefix.route_type != BGP_EVPN_IP_PREFIX_ROUTE))
return RMAP_NOOP;
- if (path->extra == NULL)
- return RMAP_NOMATCH;
-
- for (;
- label_cnt < BGP_MAX_LABELS && label_cnt < path->extra->num_labels;
+ for (label_cnt = 0; label_cnt < BGP_MAX_LABELS &&
+ label_cnt < bgp_path_info_num_labels(path);
label_cnt++) {
if (vni == label2vni(&path->extra->label[label_cnt]))
return RMAP_MATCH;
diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c
index f5508a0a73..63742fad4a 100644
--- a/bgpd/bgp_rpki.c
+++ b/bgpd/bgp_rpki.c
@@ -656,17 +656,16 @@ static void revalidate_bgp_node(struct bgp_dest *bgp_dest, afi_t afi,
safi_t safi)
{
struct bgp_adj_in *ain;
+ mpls_label_t *label;
+ uint32_t num_labels;
for (ain = bgp_dest->adj_in; ain; ain = ain->next) {
struct bgp_path_info *path =
bgp_dest_get_bgp_path_info(bgp_dest);
- mpls_label_t *label = NULL;
- uint32_t num_labels = 0;
- if (path && path->extra) {
- label = path->extra->label;
- num_labels = path->extra->num_labels;
- }
+ num_labels = bgp_path_info_num_labels(path);
+ label = num_labels ? path->extra->label : NULL;
+
(void)bgp_update(ain->peer, bgp_dest_get_prefix(bgp_dest),
ain->addpath_rx_id, ain->attr, afi, safi,
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL, label,
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c
index 1f691b6a9e..def2afb6da 100644
--- a/bgpd/bgp_updgrp_packet.c
+++ b/bgpd/bgp_updgrp_packet.c
@@ -814,9 +814,10 @@ struct bpacket *subgroup_update_packet(struct update_subgroup *subgrp)
path);
label_pnt = &label;
num_labels = 1;
- } else if (path && path->extra) {
- label_pnt = &path->extra->label[0];
- num_labels = path->extra->num_labels;
+ } else {
+ num_labels = bgp_path_info_num_labels(path);
+ label_pnt = num_labels ? &path->extra->label[0]
+ : NULL;
}
if (stream_empty(snlri))
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 49b3ef3712..623839d212 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -1301,8 +1301,6 @@ static void bgp_zebra_announce_parse_nexthop(
}
for (; mpinfo; mpinfo = bgp_path_info_mpath_next(mpinfo)) {
- labels = NULL;
- num_labels = 0;
uint64_t nh_weight;
bool is_evpn;
bool is_parent_evpn;
@@ -1341,7 +1339,7 @@ static void bgp_zebra_announce_parse_nexthop(
api_nh->srte_color = bgp_attr_get_color(info->attr);
if (bgp_debug_zebra(&api->prefix)) {
- if (mpinfo->extra && mpinfo->extra->num_labels) {
+ if (bgp_path_info_num_labels(mpinfo)) {
zlog_debug("%s: p=%pFX, bgp_is_valid_label: %d",
__func__, p,
bgp_is_valid_label(
@@ -1413,13 +1411,10 @@ static void bgp_zebra_announce_parse_nexthop(
mpinfo->peer->sort == BGP_PEER_CONFED))
*allow_recursion = true;
- if (mpinfo->extra) {
- labels = mpinfo->extra->label;
- num_labels = mpinfo->extra->num_labels;
- }
+ num_labels = bgp_path_info_num_labels(mpinfo);
+ labels = num_labels ? mpinfo->extra->label : NULL;
- if (labels && (num_labels > 0) &&
- (is_evpn || bgp_is_valid_label(&labels[0]))) {
+ if (num_labels && (is_evpn || bgp_is_valid_label(&labels[0]))) {
enum lsp_types_t nh_label_type = ZEBRA_LSP_NONE;
if (is_evpn) {
diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c
index 7fb7d5d7aa..7e19fb8c97 100644
--- a/bgpd/rfapi/rfapi_import.c
+++ b/bgpd/rfapi/rfapi_import.c
@@ -1271,7 +1271,7 @@ rfapiRouteInfo2NextHopEntry(struct rfapi_ip_prefix *rprefix,
/* label comes from MP_REACH_NLRI label */
vo->v.l2addr.label =
- bpi->extra->num_labels
+ bgp_path_info_num_labels(bpi)
? decode_label(&bpi->extra->label[0])
: MPLS_INVALID_LABEL;
@@ -4166,7 +4166,7 @@ static void rfapiBgpTableFilteredImport(struct bgp *bgp,
BGP_PATH_REMOVED))
continue;
- if (bpi->extra && bpi->extra->num_labels)
+ if (bgp_path_info_num_labels(bpi))
label = decode_label(
&bpi->extra->label[0]);
(*rfapiBgpInfoFilteredImportFunction(
diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c
index 11dccbf1b5..5c63576720 100644
--- a/bgpd/rfapi/rfapi_rib.c
+++ b/bgpd/rfapi/rfapi_rib.c
@@ -692,7 +692,7 @@ static void rfapiRibBi2Ri(struct bgp_path_info *bpi, struct rfapi_info *ri,
/* label comes from MP_REACH_NLRI label */
vo->v.l2addr.label =
- bpi->extra->num_labels
+ bgp_path_info_num_labels(bpi)
? decode_label(&bpi->extra->label[0])
: MPLS_INVALID_LABEL;
diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c
index 2576a283f5..ddf95b63fc 100644
--- a/bgpd/rfapi/rfapi_vty.c
+++ b/bgpd/rfapi/rfapi_vty.c
@@ -413,7 +413,7 @@ void rfapi_vty_out_vncinfo(struct vty *vty, const struct prefix *p,
XFREE(MTYPE_ECOMMUNITY_STR, s);
}
- if (bpi->extra != NULL && bpi->extra->num_labels) {
+ if (bgp_path_info_num_labels(bpi)) {
if (bpi->extra->label[0] == BGP_PREVENT_VRF_2_VRF_LEAK)
vty_out(vty, " label=VRF2VRF");
else
@@ -1052,7 +1052,7 @@ static int rfapiPrintRemoteRegBi(struct bgp *bgp, void *stream,
snprintf(buf_un, sizeof(buf_un), "%s",
inet_ntop(pfx_vn.family, &pfx_vn.u.prefix, buf_ntop,
sizeof(buf_ntop)));
- if (bpi->extra && bpi->extra->num_labels) {
+ if (bgp_path_info_num_labels(bpi)) {
uint32_t l = decode_label(&bpi->extra->label[0]);
snprintf(buf_vn, sizeof(buf_vn), "Label: %d", l);
} else /* should never happen */
@@ -1161,8 +1161,7 @@ static int rfapiPrintRemoteRegBi(struct bgp *bgp, void *stream,
}
}
}
- if (tun_type != BGP_ENCAP_TYPE_MPLS && bpi->extra &&
- bpi->extra->num_labels) {
+ if (tun_type != BGP_ENCAP_TYPE_MPLS && bgp_path_info_num_labels(bpi)) {
uint32_t l = decode_label(&bpi->extra->label[0]);
if (!MPLS_LABEL_IS_NULL(l)) {
diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c
index 09260dbca1..fbc0256128 100644
--- a/bgpd/rfapi/vnc_import_bgp.c
+++ b/bgpd/rfapi/vnc_import_bgp.c
@@ -470,7 +470,7 @@ static void vnc_import_bgp_add_route_mode_resolve_nve_one_bi(
if (bgp_attr_get_ecommunity(bpi->attr))
ecommunity_merge(new_ecom, bgp_attr_get_ecommunity(bpi->attr));
- if (bpi->extra && bpi->extra->num_labels)
+ if (bgp_path_info_num_labels(bpi))
label = decode_label(&bpi->extra->label[0]);
add_vnc_route(&vncHDResolveNve, bgp, SAFI_MPLS_VPN,
@@ -1699,7 +1699,8 @@ static void vnc_import_bgp_exterior_add_route_it(
if (bpi_interior->extra) {
prd = &bpi_interior->extra->vnc->vnc
.import.rd;
- if (bpi_interior->extra->num_labels)
+ if (bgp_path_info_num_labels(
+ bpi_interior))
label = decode_label(
&bpi_interior->extra
->label[0]);
@@ -1870,7 +1871,8 @@ void vnc_import_bgp_exterior_del_route(
if (bpi_interior->extra) {
prd = &bpi_interior->extra->vnc->vnc
.import.rd;
- if (bpi_interior->extra->num_labels)
+ if (bgp_path_info_num_labels(
+ bpi_interior))
label = decode_label(
&bpi_interior->extra
->label[0]);
@@ -2019,7 +2021,7 @@ void vnc_import_bgp_exterior_add_route_interior(
if (bpi_interior->extra) {
prd = &bpi_interior->extra->vnc->vnc.import.rd;
- if (bpi_interior->extra->num_labels)
+ if (bgp_path_info_num_labels(bpi_interior))
label = decode_label(
&bpi_interior->extra->label[0]);
} else
@@ -2134,7 +2136,7 @@ void vnc_import_bgp_exterior_add_route_interior(
if (bpi->extra) {
prd = &bpi->extra->vnc->vnc
.import.rd;
- if (bpi->extra->num_labels)
+ if (bgp_path_info_num_labels(bpi))
label = decode_label(
&bpi->extra->label
[0]);
@@ -2158,7 +2160,8 @@ void vnc_import_bgp_exterior_add_route_interior(
if (bpi_interior->extra) {
prd = &bpi_interior->extra->vnc->vnc
.import.rd;
- if (bpi_interior->extra->num_labels)
+ if (bgp_path_info_num_labels(
+ bpi_interior))
label = decode_label(
&bpi_interior->extra
->label[0]);
@@ -2278,7 +2281,7 @@ void vnc_import_bgp_exterior_add_route_interior(
*/
if (bpi_interior->extra) {
prd = &bpi_interior->extra->vnc->vnc.import.rd;
- if (bpi_interior->extra->num_labels)
+ if (bgp_path_info_num_labels(bpi_interior))
label = decode_label(
&bpi_interior->extra->label[0]);
} else
@@ -2387,7 +2390,7 @@ void vnc_import_bgp_exterior_del_route_interior(
if (bpi_interior->extra) {
prd = &bpi_interior->extra->vnc->vnc.import.rd;
- if (bpi_interior->extra->num_labels)
+ if (bgp_path_info_num_labels(bpi_interior))
label = decode_label(
&bpi_interior->extra->label[0]);
} else
@@ -2466,7 +2469,7 @@ void vnc_import_bgp_exterior_del_route_interior(
if (bpi->extra) {
prd = &bpi->extra->vnc->vnc.import.rd;
- if (bpi->extra->num_labels)
+ if (bgp_path_info_num_labels(bpi))
label = decode_label(
&bpi->extra->label[0]);
} else