From 0826e83cf6757a9ed47492b0cdce52f4d18a6647 Mon Sep 17 00:00:00 2001 From: Daniel Walton Date: Tue, 20 Jun 2017 14:50:00 +0000 Subject: [PATCH] bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table Signed-off-by: Daniel Walton --- bgpd/bgp_route.c | 8 ++++---- bgpd/bgp_zebra.c | 8 ++++---- bgpd/rfapi/rfapi.c | 4 ++-- bgpd/rfapi/rfapi_import.c | 6 +++--- bgpd/rfapi/rfapi_rib.c | 2 +- bgpd/rfapi/rfapi_vty.c | 6 +++--- bgpd/rfapi/vnc_import_bgp.c | 18 +++++++++--------- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 15367ec7c7..f0c3dcf52b 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4099,7 +4099,7 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p, struct attr attr = { 0 }; struct bgp_info *ri; #if ENABLE_BGP_VNC - u_int32_t label = 0; + mpls_label_t label = 0; #endif union gw_addr add; @@ -4209,7 +4209,7 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p, ri->uptime = bgp_clock (); #if ENABLE_BGP_VNC if (ri->extra) - label = decode_label (ri->extra->tag); + label = decode_label (&ri->extra->label); #endif /* Process change. */ @@ -4235,7 +4235,7 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p, new->extra = bgp_info_extra_new(); new->extra->label = bgp_static->label; #if ENABLE_BGP_VNC - label = decode_label (bgp_static->label); + label = decode_label (&bgp_static->label); #endif /* Aggregate address increment. */ @@ -8147,7 +8147,7 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp, int local_as = 0; int first = 1; int has_valid_label = 0; - uint32_t label = 0; + mpls_label_t label; json_object *json_adv_to = NULL; p = &rn->p; diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 9703183279..74934f132c 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1347,7 +1347,7 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info { has_valid_label = 1; 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; 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++; } @@ -1567,7 +1567,7 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info { has_valid_label = 1; 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++; } @@ -1616,7 +1616,7 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info { has_valid_label = 1; 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++; } diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index 69fae2ae40..ada9d0d181 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -1170,7 +1170,7 @@ add_vnc_route ( /* save backref to rfapi handle */ assert (bgp_info_extra_get (new)); new->extra->vnc.export.rfapi_handle = (void *) rfd; - encode_label (label_val, new->extra->tag); + encode_label (label_val, &new->extra->label); /* debug */ @@ -1197,7 +1197,7 @@ add_vnc_route ( bgp, prd, table, p, new); } bgp_unlock_node (prn); - encode_label (label_val, bn->local_label); + encode_label (label_val, &bn->local_label); } bgp_unlock_node (bn); diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index cefb9ef85a..e5d9c1635c 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -543,7 +543,7 @@ rfapiBgpInfoCreate ( rfapi_time (&new->extra->vnc.import.create_time); } if (label) - encode_label (*label, new->extra->tag); + encode_label (*label, &new->extra->label); new->type = type; new->sub_type = sub_type; new->peer = peer; @@ -1431,7 +1431,7 @@ rfapiRouteInfo2NextHopEntry ( vo->v.l2addr.local_nve_id = bi->extra->vnc.import.rd.val[1]; /* 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; @@ -4542,7 +4542,7 @@ rfapiBgpTableFilteredImport ( continue; if (bi->extra) - label = decode_label (bi->extra->tag); + label = decode_label (&bi->extra->label); (*rfapiBgpInfoFilteredImportFunction (safi)) ( it, /* which import table */ FIF_ACTION_UPDATE, diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c index 04c69d58ac..99cce4a067 100644 --- a/bgpd/rfapi/rfapi_rib.c +++ b/bgpd/rfapi/rfapi_rib.c @@ -735,7 +735,7 @@ rfapiRibBi2Ri( vo->v.l2addr.local_nve_id = bi->extra->vnc.import.rd.val[1]; /* 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 */ ri->vn_options = vo; diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index 7c5d6ce3fa..43f5bff4fa 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -478,7 +478,7 @@ rfapi_vty_out_vncinfo ( } 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)) { @@ -1178,7 +1178,7 @@ rfapiPrintRemoteRegBi ( inet_ntop (pfx_vn.family, &pfx_vn.u.prefix, buf_ntop, BUFSIZ)); 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); } else /* should never happen */ @@ -1305,7 +1305,7 @@ rfapiPrintRemoteRegBi ( } 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)) { fp (out, " Label: %d", l); diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c index cb9c474d92..47203cd238 100644 --- a/bgpd/rfapi/vnc_import_bgp.c +++ b/bgpd/rfapi/vnc_import_bgp.c @@ -536,7 +536,7 @@ vnc_import_bgp_add_route_mode_resolve_nve_one_bi ( ecommunity_merge (new_ecom, bi->attr->extra->ecommunity); if (bi->extra) - label = decode_label (bi->extra->tag); + label = decode_label (&bi->extra->label); add_vnc_route ( &vncHDResolveNve, @@ -1919,7 +1919,7 @@ vnc_import_bgp_exterior_add_route_it ( if (bi_interior->extra) { prd = &bi_interior->extra->vnc.import.rd; - label = decode_label (bi_interior->extra->tag); + label = decode_label (&bi_interior->extra->label); } else prd = NULL; @@ -2101,7 +2101,7 @@ vnc_import_bgp_exterior_del_route ( if (bi_interior->extra) { prd = &bi_interior->extra->vnc.import.rd; - label = decode_label (bi_interior->extra->tag); + label = decode_label (&bi_interior->extra->label); } else prd = NULL; @@ -2249,7 +2249,7 @@ vnc_import_bgp_exterior_add_route_interior ( if (bi_interior->extra) { prd = &bi_interior->extra->vnc.import.rd; - label = decode_label (bi_interior->extra->tag); + label = decode_label (&bi_interior->extra->label); } else prd = NULL; @@ -2364,7 +2364,7 @@ vnc_import_bgp_exterior_add_route_interior ( if (bi->extra) { prd = &bi->extra->vnc.import.rd; - label = decode_label (bi->extra->tag); + label = decode_label (&bi->extra->label); } else prd = NULL; @@ -2388,7 +2388,7 @@ vnc_import_bgp_exterior_add_route_interior ( if (bi_interior->extra) { prd = &bi_interior->extra->vnc.import.rd; - label = decode_label (bi_interior->extra->tag); + label = decode_label (&bi_interior->extra->label); } else prd = NULL; @@ -2512,7 +2512,7 @@ vnc_import_bgp_exterior_add_route_interior ( if (bi_interior->extra) { prd = &bi_interior->extra->vnc.import.rd; - label = decode_label (bi_interior->extra->tag); + label = decode_label (&bi_interior->extra->label); } else prd = NULL; @@ -2633,7 +2633,7 @@ vnc_import_bgp_exterior_del_route_interior ( if (bi_interior->extra) { prd = &bi_interior->extra->vnc.import.rd; - label = decode_label (bi_interior->extra->tag); + label = decode_label (&bi_interior->extra->label); } else prd = NULL; @@ -2716,7 +2716,7 @@ vnc_import_bgp_exterior_del_route_interior ( if (bi->extra) { prd = &bi->extra->vnc.import.rd; - label = decode_label (bi->extra->tag); + label = decode_label (&bi->extra->label); } else prd = NULL;