summaryrefslogtreecommitdiff
path: root/bgpd/rfapi/rfapi_import.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/rfapi/rfapi_import.c')
-rw-r--r--bgpd/rfapi/rfapi_import.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c
index 7e19fb8c97..2afcb2f45c 100644
--- a/bgpd/rfapi/rfapi_import.c
+++ b/bgpd/rfapi/rfapi_import.c
@@ -442,6 +442,7 @@ static struct bgp_path_info *rfapiBgpInfoCreate(struct attr *attr,
uint32_t *label)
{
struct bgp_path_info *new;
+ struct bgp_labels bgp_labels = {};
new = info_make(type, sub_type, 0, peer, attr, NULL);
@@ -455,10 +456,10 @@ static struct bgp_path_info *rfapiBgpInfoCreate(struct attr *attr,
new->extra->vnc->vnc.import.create_time = monotime(NULL);
}
if (label && *label != MPLS_INVALID_LABEL) {
- encode_label(*label, &new->extra->label[0]);
- new->extra->num_labels = 1;
- } else
- new->extra->num_labels = 0;
+ encode_label(*label, &bgp_labels.label[0]);
+ bgp_labels.num_labels = 1;
+ new->extra->labels = bgp_labels_intern(&bgp_labels);
+ }
peer_lock(peer);
@@ -1272,7 +1273,7 @@ rfapiRouteInfo2NextHopEntry(struct rfapi_ip_prefix *rprefix,
/* label comes from MP_REACH_NLRI label */
vo->v.l2addr.label =
bgp_path_info_num_labels(bpi)
- ? decode_label(&bpi->extra->label[0])
+ ? decode_label(&bpi->extra->labels->label[0])
: MPLS_INVALID_LABEL;
new->vn_options = vo;
@@ -4168,7 +4169,8 @@ static void rfapiBgpTableFilteredImport(struct bgp *bgp,
if (bgp_path_info_num_labels(bpi))
label = decode_label(
- &bpi->extra->label[0]);
+ &bpi->extra->labels
+ ->label[0]);
(*rfapiBgpInfoFilteredImportFunction(
safi))(
it, /* which import table */