bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
This commit is contained in:
Daniel Walton 2017-06-20 14:50:00 +00:00
parent 9bedbb1e52
commit 0826e83cf6
7 changed files with 26 additions and 26 deletions

View File

@ -4099,7 +4099,7 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p,
struct attr attr = { 0 }; struct attr attr = { 0 };
struct bgp_info *ri; struct bgp_info *ri;
#if ENABLE_BGP_VNC #if ENABLE_BGP_VNC
u_int32_t label = 0; mpls_label_t label = 0;
#endif #endif
union gw_addr add; union gw_addr add;
@ -4209,7 +4209,7 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p,
ri->uptime = bgp_clock (); ri->uptime = bgp_clock ();
#if ENABLE_BGP_VNC #if ENABLE_BGP_VNC
if (ri->extra) if (ri->extra)
label = decode_label (ri->extra->tag); label = decode_label (&ri->extra->label);
#endif #endif
/* Process change. */ /* Process change. */
@ -4235,7 +4235,7 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p,
new->extra = bgp_info_extra_new(); new->extra = bgp_info_extra_new();
new->extra->label = bgp_static->label; new->extra->label = bgp_static->label;
#if ENABLE_BGP_VNC #if ENABLE_BGP_VNC
label = decode_label (bgp_static->label); label = decode_label (&bgp_static->label);
#endif #endif
/* Aggregate address increment. */ /* Aggregate address increment. */
@ -8147,7 +8147,7 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp,
int local_as = 0; int local_as = 0;
int first = 1; int first = 1;
int has_valid_label = 0; int has_valid_label = 0;
uint32_t label = 0; mpls_label_t label;
json_object *json_adv_to = NULL; json_object *json_adv_to = NULL;
p = &rn->p; p = &rn->p;

View File

@ -1347,7 +1347,7 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info
{ {
has_valid_label = 1; has_valid_label = 1;
label = label_pton(&info->extra->label); label = label_pton(&info->extra->label);
stream_put (bgp_label_buf, &label, sizeof (u_int32_t)); stream_put (bgp_label_buf, &label, sizeof (mpls_label_t));
} }
} }
@ -1378,7 +1378,7 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info
{ {
has_valid_label = 1; has_valid_label = 1;
label = label_pton(&mpinfo->extra->label); label = label_pton(&mpinfo->extra->label);
stream_put (bgp_label_buf, &label, sizeof (u_int32_t)); stream_put (bgp_label_buf, &label, sizeof (mpls_label_t));
} }
valid_nh_count++; valid_nh_count++;
} }
@ -1567,7 +1567,7 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info
{ {
has_valid_label = 1; has_valid_label = 1;
label = label_pton(&info->extra->label); label = label_pton(&info->extra->label);
stream_put (bgp_label_buf, &label, sizeof (u_int32_t)); stream_put (bgp_label_buf, &label, sizeof (mpls_label_t));
} }
valid_nh_count++; valid_nh_count++;
} }
@ -1616,7 +1616,7 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info
{ {
has_valid_label = 1; has_valid_label = 1;
label = label_pton(&mpinfo->extra->label); label = label_pton(&mpinfo->extra->label);
stream_put (bgp_label_buf, &label, sizeof (u_int32_t)); stream_put (bgp_label_buf, &label, sizeof (mpls_label_t));
} }
valid_nh_count++; valid_nh_count++;
} }

View File

@ -1170,7 +1170,7 @@ add_vnc_route (
/* save backref to rfapi handle */ /* save backref to rfapi handle */
assert (bgp_info_extra_get (new)); assert (bgp_info_extra_get (new));
new->extra->vnc.export.rfapi_handle = (void *) rfd; new->extra->vnc.export.rfapi_handle = (void *) rfd;
encode_label (label_val, new->extra->tag); encode_label (label_val, &new->extra->label);
/* debug */ /* debug */
@ -1197,7 +1197,7 @@ add_vnc_route (
bgp, prd, table, p, new); bgp, prd, table, p, new);
} }
bgp_unlock_node (prn); bgp_unlock_node (prn);
encode_label (label_val, bn->local_label); encode_label (label_val, &bn->local_label);
} }
bgp_unlock_node (bn); bgp_unlock_node (bn);

View File

@ -543,7 +543,7 @@ rfapiBgpInfoCreate (
rfapi_time (&new->extra->vnc.import.create_time); rfapi_time (&new->extra->vnc.import.create_time);
} }
if (label) if (label)
encode_label (*label, new->extra->tag); encode_label (*label, &new->extra->label);
new->type = type; new->type = type;
new->sub_type = sub_type; new->sub_type = sub_type;
new->peer = peer; new->peer = peer;
@ -1431,7 +1431,7 @@ rfapiRouteInfo2NextHopEntry (
vo->v.l2addr.local_nve_id = bi->extra->vnc.import.rd.val[1]; vo->v.l2addr.local_nve_id = bi->extra->vnc.import.rd.val[1];
/* label comes from MP_REACH_NLRI label */ /* label comes from MP_REACH_NLRI label */
vo->v.l2addr.label = decode_label (bi->extra->tag); vo->v.l2addr.label = decode_label (&bi->extra->label);
new->vn_options = vo; new->vn_options = vo;
@ -4542,7 +4542,7 @@ rfapiBgpTableFilteredImport (
continue; continue;
if (bi->extra) if (bi->extra)
label = decode_label (bi->extra->tag); label = decode_label (&bi->extra->label);
(*rfapiBgpInfoFilteredImportFunction (safi)) ( (*rfapiBgpInfoFilteredImportFunction (safi)) (
it, /* which import table */ it, /* which import table */
FIF_ACTION_UPDATE, FIF_ACTION_UPDATE,

View File

@ -735,7 +735,7 @@ rfapiRibBi2Ri(
vo->v.l2addr.local_nve_id = bi->extra->vnc.import.rd.val[1]; vo->v.l2addr.local_nve_id = bi->extra->vnc.import.rd.val[1];
/* label comes from MP_REACH_NLRI label */ /* label comes from MP_REACH_NLRI label */
vo->v.l2addr.label = decode_label (bi->extra->tag); vo->v.l2addr.label = decode_label (&bi->extra->label);
rfapi_vn_options_free (ri->vn_options); /* maybe free old version */ rfapi_vn_options_free (ri->vn_options); /* maybe free old version */
ri->vn_options = vo; ri->vn_options = vo;

View File

@ -478,7 +478,7 @@ rfapi_vty_out_vncinfo (
} }
if (bi->extra != NULL) if (bi->extra != NULL)
vty_out (vty, " label=%u", decode_label (bi->extra->tag)); vty_out (vty, " label=%u", decode_label (&bi->extra->label));
if (!rfapiGetVncLifetime (bi->attr, &lifetime)) if (!rfapiGetVncLifetime (bi->attr, &lifetime))
{ {
@ -1178,7 +1178,7 @@ rfapiPrintRemoteRegBi (
inet_ntop (pfx_vn.family, &pfx_vn.u.prefix, buf_ntop, BUFSIZ)); inet_ntop (pfx_vn.family, &pfx_vn.u.prefix, buf_ntop, BUFSIZ));
if (bi->extra) if (bi->extra)
{ {
u_int32_t l = decode_label (bi->extra->tag); u_int32_t l = decode_label (&bi->extra->label);
snprintf (buf_vn, BUFSIZ, "Label: %d", l); snprintf (buf_vn, BUFSIZ, "Label: %d", l);
} }
else /* should never happen */ else /* should never happen */
@ -1305,7 +1305,7 @@ rfapiPrintRemoteRegBi (
} }
if (tun_type != BGP_ENCAP_TYPE_MPLS && bi->extra) if (tun_type != BGP_ENCAP_TYPE_MPLS && bi->extra)
{ {
u_int32_t l = decode_label (bi->extra->tag); u_int32_t l = decode_label (&bi->extra->label);
if (!MPLS_LABEL_IS_NULL (l)) if (!MPLS_LABEL_IS_NULL (l))
{ {
fp (out, " Label: %d", l); fp (out, " Label: %d", l);

View File

@ -536,7 +536,7 @@ vnc_import_bgp_add_route_mode_resolve_nve_one_bi (
ecommunity_merge (new_ecom, bi->attr->extra->ecommunity); ecommunity_merge (new_ecom, bi->attr->extra->ecommunity);
if (bi->extra) if (bi->extra)
label = decode_label (bi->extra->tag); label = decode_label (&bi->extra->label);
add_vnc_route ( add_vnc_route (
&vncHDResolveNve, &vncHDResolveNve,
@ -1919,7 +1919,7 @@ vnc_import_bgp_exterior_add_route_it (
if (bi_interior->extra) if (bi_interior->extra)
{ {
prd = &bi_interior->extra->vnc.import.rd; prd = &bi_interior->extra->vnc.import.rd;
label = decode_label (bi_interior->extra->tag); label = decode_label (&bi_interior->extra->label);
} }
else else
prd = NULL; prd = NULL;
@ -2101,7 +2101,7 @@ vnc_import_bgp_exterior_del_route (
if (bi_interior->extra) if (bi_interior->extra)
{ {
prd = &bi_interior->extra->vnc.import.rd; prd = &bi_interior->extra->vnc.import.rd;
label = decode_label (bi_interior->extra->tag); label = decode_label (&bi_interior->extra->label);
} }
else else
prd = NULL; prd = NULL;
@ -2249,7 +2249,7 @@ vnc_import_bgp_exterior_add_route_interior (
if (bi_interior->extra) if (bi_interior->extra)
{ {
prd = &bi_interior->extra->vnc.import.rd; prd = &bi_interior->extra->vnc.import.rd;
label = decode_label (bi_interior->extra->tag); label = decode_label (&bi_interior->extra->label);
} }
else else
prd = NULL; prd = NULL;
@ -2364,7 +2364,7 @@ vnc_import_bgp_exterior_add_route_interior (
if (bi->extra) if (bi->extra)
{ {
prd = &bi->extra->vnc.import.rd; prd = &bi->extra->vnc.import.rd;
label = decode_label (bi->extra->tag); label = decode_label (&bi->extra->label);
} }
else else
prd = NULL; prd = NULL;
@ -2388,7 +2388,7 @@ vnc_import_bgp_exterior_add_route_interior (
if (bi_interior->extra) if (bi_interior->extra)
{ {
prd = &bi_interior->extra->vnc.import.rd; prd = &bi_interior->extra->vnc.import.rd;
label = decode_label (bi_interior->extra->tag); label = decode_label (&bi_interior->extra->label);
} }
else else
prd = NULL; prd = NULL;
@ -2512,7 +2512,7 @@ vnc_import_bgp_exterior_add_route_interior (
if (bi_interior->extra) if (bi_interior->extra)
{ {
prd = &bi_interior->extra->vnc.import.rd; prd = &bi_interior->extra->vnc.import.rd;
label = decode_label (bi_interior->extra->tag); label = decode_label (&bi_interior->extra->label);
} }
else else
prd = NULL; prd = NULL;
@ -2633,7 +2633,7 @@ vnc_import_bgp_exterior_del_route_interior (
if (bi_interior->extra) if (bi_interior->extra)
{ {
prd = &bi_interior->extra->vnc.import.rd; prd = &bi_interior->extra->vnc.import.rd;
label = decode_label (bi_interior->extra->tag); label = decode_label (&bi_interior->extra->label);
} }
else else
prd = NULL; prd = NULL;
@ -2716,7 +2716,7 @@ vnc_import_bgp_exterior_del_route_interior (
if (bi->extra) if (bi->extra)
{ {
prd = &bi->extra->vnc.import.rd; prd = &bi->extra->vnc.import.rd;
label = decode_label (bi->extra->tag); label = decode_label (&bi->extra->label);
} }
else else
prd = NULL; prd = NULL;