From: mitesh Date: Thu, 18 Jan 2018 18:27:26 +0000 (-0800) Subject: zebra/bgpd: fix compilation issues X-Git-Tag: frr-5.0-dev~244^2~4 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=317f1fe02fa8a6fea0fe9530078edf54335f3228;p=matthieu%2Ffrr.git zebra/bgpd: fix compilation issues Signed-off-by: Mitesh Kanjariya --- diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 438b29b4ef..8ad8dc8ee2 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -1274,7 +1274,7 @@ static int update_evpn_route(struct bgp *bgp, struct bgpevpn *vpn, attr.nexthop = vpn->originator_ip; attr.mp_nexthop_global_in = vpn->originator_ip; attr.mp_nexthop_len = BGP_ATTR_NHLEN_IPV4; - attr.sticky = CHECK_FLAG(flags, ZEBRA_MAC_TYPE_STICKY) ? 1 : 0; + attr.sticky = CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_STICKY) ? 1 : 0; attr.default_gw = CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_GW) ? 1 : 0; attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL); bgpevpn_get_rmac(vpn, &attr.rmac); @@ -3522,7 +3522,6 @@ int bgp_evpn_uninstall_routes(struct bgp *bgp, struct bgpevpn *vpn) char *bgp_evpn_label2str(mpls_label_t *label, u_int32_t num_labels, char *buf, int len) { - vni_t vni; vni_t vni1, vni2; vni1 = label2vni(label); @@ -4202,7 +4201,7 @@ int bgp_evpn_local_macip_add(struct bgp *bgp, vni_t vni, struct ethaddr *mac, zlog_err( "%u:Failed to create Type-2 route, VNI %u %s MAC %s IP %s (flags: 0x%x)", bgp->vrf_id, vpn->vni, - CHECK_FLAG(flags, ZEBRA_MAC_TYPE_STICKY) ? "sticky gateway" + CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_STICKY) ? "sticky gateway" : "", prefix_mac2str(mac, buf, sizeof(buf)), ipaddr2str(ip, buf2, sizeof(buf2)), diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 5ed1b42407..36e0c92482 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4472,7 +4472,7 @@ static void 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->label); + label = decode_label(&ri->extra->label[0]); #endif /* Process change. */ diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index 95666143a5..9d169eed32 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -1083,7 +1083,7 @@ void add_vnc_route(struct rfapi_descriptor *rfd, /* cookie, VPN UN addr, peer */ /* 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->label); + encode_label(label_val, &new->extra->label[0]); /* debug */ diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index 8727c5d5ea..e1508dbd83 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -521,7 +521,7 @@ static struct bgp_info *rfapiBgpInfoCreate(struct attr *attr, struct peer *peer, rfapi_time(&new->extra->vnc.import.create_time); } if (label) - encode_label(*label, &new->extra->label); + encode_label(*label, &new->extra->label[0]); new->type = type; new->sub_type = sub_type; new->peer = peer; @@ -1338,7 +1338,7 @@ rfapiRouteInfo2NextHopEntry(struct rfapi_ip_prefix *rprefix, 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->label); + vo->v.l2addr.label = decode_label(&bi->extra->label[0]); new->vn_options = vo; @@ -4242,7 +4242,7 @@ static void rfapiBgpTableFilteredImport(struct bgp *bgp, if (bi->extra) label = decode_label( - &bi->extra->label); + &bi->extra->label[0]); (*rfapiBgpInfoFilteredImportFunction( safi))( it, /* which import table */ diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c index bd79518bfd..271c748510 100644 --- a/bgpd/rfapi/rfapi_rib.c +++ b/bgpd/rfapi/rfapi_rib.c @@ -697,7 +697,7 @@ static void rfapiRibBi2Ri(struct bgp_info *bi, struct rfapi_info *ri, 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->label); + vo->v.l2addr.label = decode_label(&bi->extra->label[0]); rfapi_vn_options_free( ri->vn_options); /* maybe free old version */ diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index 37ca5edc96..36100d5429 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -432,7 +432,7 @@ void rfapi_vty_out_vncinfo(struct vty *vty, struct prefix *p, } if (bi->extra != NULL) - vty_out(vty, " label=%u", decode_label(&bi->extra->label)); + vty_out(vty, " label=%u", decode_label(&bi->extra->label[0])); if (!rfapiGetVncLifetime(bi->attr, &lifetime)) { vty_out(vty, " life=%d", lifetime); @@ -1068,7 +1068,7 @@ static int rfapiPrintRemoteRegBi(struct bgp *bgp, void *stream, inet_ntop(pfx_vn.family, &pfx_vn.u.prefix, buf_ntop, BUFSIZ)); if (bi->extra) { - u_int32_t l = decode_label(&bi->extra->label); + u_int32_t l = decode_label(&bi->extra->label[0]); snprintf(buf_vn, BUFSIZ, "Label: %d", l); } else /* should never happen */ { @@ -1181,7 +1181,7 @@ static int rfapiPrintRemoteRegBi(struct bgp *bgp, void *stream, } } if (tun_type != BGP_ENCAP_TYPE_MPLS && bi->extra) { - u_int32_t l = decode_label(&bi->extra->label); + u_int32_t l = decode_label(&bi->extra->label[0]); if (!MPLS_LABEL_IS_NULL(l)) { fp(out, " Label: %d", l); if (nlines == 1) diff --git a/bgpd/rfapi/vnc_export_bgp.c b/bgpd/rfapi/vnc_export_bgp.c index a37e705612..e88dd9399c 100644 --- a/bgpd/rfapi/vnc_export_bgp.c +++ b/bgpd/rfapi/vnc_export_bgp.c @@ -398,7 +398,7 @@ void vnc_direct_bgp_del_route_ce(struct bgp *bgp, struct route_node *rn, NULL, /* attr, ignored */ afi, SAFI_UNICAST, ZEBRA_ROUTE_VNC_DIRECT, BGP_ROUTE_REDISTRIBUTE, NULL, /* RD not used for unicast */ - NULL, NULL); /* tag not used for unicast */ + NULL, 0, NULL); /* tag not used for unicast */ } static void vnc_direct_bgp_vpn_enable_ce(struct bgp *bgp, afi_t afi) @@ -498,7 +498,7 @@ static void vnc_direct_bgp_vpn_disable_ce(struct bgp *bgp, afi_t afi) ZEBRA_ROUTE_VNC_DIRECT, BGP_ROUTE_REDISTRIBUTE, NULL, /* RD not used for unicast */ - NULL, + NULL, 0, NULL); /* tag not used for unicast */ } } @@ -880,7 +880,7 @@ void vnc_direct_bgp_del_prefix(struct bgp *bgp, afi, SAFI_UNICAST, ZEBRA_ROUTE_VNC_DIRECT, BGP_ROUTE_REDISTRIBUTE, NULL, /* RD not used for unicast */ - NULL, NULL); /* tag not used for unicast */ + NULL, 0, NULL); /* tag not used for unicast */ /* * yuck! * - but consistent with rest of function @@ -909,7 +909,7 @@ void vnc_direct_bgp_del_prefix(struct bgp *bgp, afi, SAFI_UNICAST, ZEBRA_ROUTE_VNC_DIRECT, BGP_ROUTE_REDISTRIBUTE, NULL, /* RD not used for unicast */ - NULL, NULL); /* tag not used for unicast */ + NULL, 0, NULL); /* tag not used for unicast */ } } } @@ -1048,7 +1048,7 @@ void vnc_direct_bgp_add_nve(struct bgp *bgp, struct rfapi_descriptor *rfd) unicast */ NULL, /* tag not used for unicast */ - 0, NULL); /* EVPN not used */ + 0, 0, NULL); /* EVPN not used */ bgp_attr_unintern(&iattr); } @@ -1142,7 +1142,7 @@ void vnc_direct_bgp_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd) BGP_ROUTE_REDISTRIBUTE, NULL, /* RD not used for unicast */ - NULL, NULL); /* tag not + NULL, 0, NULL); /* tag not used for unicast */ } @@ -1260,7 +1260,7 @@ static void vnc_direct_add_rn_group_rd(struct bgp *bgp, BGP_ROUTE_REDISTRIBUTE, NULL, /* RD not used for unicast */ NULL, /* tag not used for unicast */ - 0, NULL); /* EVPN not used */ + 0, 0, NULL); /* EVPN not used */ bgp_attr_unintern(&iattr); @@ -1374,7 +1374,7 @@ static void vnc_direct_del_rn_group_rd(struct bgp *bgp, ZEBRA_ROUTE_VNC_DIRECT, BGP_ROUTE_REDISTRIBUTE, NULL, /* RD not used for unicast */ - NULL, + NULL, 0, NULL); /* tag not used for unicast */ return; } @@ -1496,7 +1496,7 @@ static void vnc_direct_bgp_unexport_table(afi_t afi, struct route_table *rt, BGP_ROUTE_REDISTRIBUTE, NULL, /* RD not used for unicast */ - NULL, NULL); /* tag not + NULL, 0, NULL); /* tag not used for unicast, EVPN @@ -1719,7 +1719,7 @@ void vnc_direct_bgp_rh_add_route(struct bgp *bgp, afi_t afi, afi, SAFI_UNICAST, ZEBRA_ROUTE_VNC_DIRECT_RH, BGP_ROUTE_REDISTRIBUTE, NULL, /* RD not used for unicast */ NULL, /* tag not used for unicast, EVPN neither */ - 0, NULL); /* EVPN not used */ + 0, 0, NULL); /* EVPN not used */ bgp_attr_unintern(&iattr); } @@ -1734,7 +1734,7 @@ static int vncExportWithdrawTimer(struct thread *t) NULL, /* attr, ignored */ family2afi(eti->node->p.family), SAFI_UNICAST, eti->type, eti->subtype, NULL, /* RD not used for unicast */ - NULL, NULL); /* tag not used for unicast, EVPN neither */ + NULL, 0, NULL); /* tag not used for unicast, EVPN neither */ /* * Free the eti @@ -1965,7 +1965,7 @@ void vnc_direct_bgp_rh_vpn_enable(struct bgp *bgp, afi_t afi) NULL, /* tag not used for unicast, EVPN neither */ - 0, NULL); /* EVPN not used */ + 0, 0, NULL); /* EVPN not used */ bgp_attr_unintern(&iattr); } } @@ -2026,7 +2026,7 @@ void vnc_direct_bgp_rh_vpn_disable(struct bgp *bgp, afi_t afi) ZEBRA_ROUTE_VNC_DIRECT_RH, BGP_ROUTE_REDISTRIBUTE, NULL, /* RD not used for unicast */ - NULL, NULL); /* tag not used for + NULL, 0, NULL); /* tag not used for unicast, EVPN neither */ } diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c index f7e86123b4..cfa4c599f2 100644 --- a/bgpd/rfapi/vnc_import_bgp.c +++ b/bgpd/rfapi/vnc_import_bgp.c @@ -495,7 +495,7 @@ static void vnc_import_bgp_add_route_mode_resolve_nve_one_bi( ecommunity_merge(new_ecom, bi->attr->ecommunity); if (bi->extra) - label = decode_label(&bi->extra->label); + label = decode_label(&bi->extra->label[0]); add_vnc_route(&vncHDResolveNve, bgp, SAFI_MPLS_VPN, prefix, /* unicast route prefix */ @@ -1783,7 +1783,7 @@ static void vnc_import_bgp_exterior_add_route_it( prd = &bi_interior->extra->vnc.import .rd; label = decode_label( - &bi_interior->extra->label); + &bi_interior->extra->label[0]); } else prd = NULL; @@ -1958,7 +1958,7 @@ void vnc_import_bgp_exterior_del_route( prd = &bi_interior->extra->vnc.import .rd; label = decode_label( - &bi_interior->extra->label); + &bi_interior->extra->label[0]); } else prd = NULL; @@ -2113,7 +2113,7 @@ void vnc_import_bgp_exterior_add_route_interior( if (bi_interior->extra) { prd = &bi_interior->extra->vnc.import.rd; label = decode_label( - &bi_interior->extra->label); + &bi_interior->extra->label[0]); } else prd = NULL; @@ -2226,7 +2226,7 @@ void vnc_import_bgp_exterior_add_route_interior( if (bi->extra) { prd = &bi->extra->vnc.import.rd; label = decode_label( - &bi->extra->label); + &bi->extra->label[0]); } else prd = NULL; @@ -2248,7 +2248,7 @@ void vnc_import_bgp_exterior_add_route_interior( prd = &bi_interior->extra->vnc.import .rd; label = decode_label( - &bi_interior->extra->label); + &bi_interior->extra->label[0]); } else prd = NULL; @@ -2369,7 +2369,7 @@ void vnc_import_bgp_exterior_add_route_interior( if (bi_interior->extra) { prd = &bi_interior->extra->vnc.import.rd; label = decode_label( - &bi_interior->extra->label); + &bi_interior->extra->label[0]); } else prd = NULL; @@ -2480,7 +2480,7 @@ void vnc_import_bgp_exterior_del_route_interior( if (bi_interior->extra) { prd = &bi_interior->extra->vnc.import.rd; - label = decode_label(&bi_interior->extra->label); + label = decode_label(&bi_interior->extra->label[0]); } else prd = NULL; @@ -2556,7 +2556,8 @@ void vnc_import_bgp_exterior_del_route_interior( if (bi->extra) { prd = &bi->extra->vnc.import.rd; - label = decode_label(&bi->extra->label); + label = decode_label( + &bi->extra->label[0]); } else prd = NULL; diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index fc4e37f0f9..bc6a18d3b5 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -2290,7 +2290,7 @@ DEFUN (default_vrf_vni_mapping, if (!zvrf) return CMD_WARNING; - ret = zebra_vxlan_process_vrf_vni_cmd(zvrf, vni, err, 1); + ret = zebra_vxlan_process_vrf_vni_cmd(zvrf, vni, err, ERR_STR_SZ, 1); if (ret != 0) { vty_out(vty, "%s\n", err); return CMD_WARNING; @@ -2315,7 +2315,7 @@ DEFUN (no_default_vrf_vni_mapping, if (!zvrf) return CMD_WARNING; - ret = zebra_vxlan_process_vrf_vni_cmd(zvrf, vni, err, 0); + ret = zebra_vxlan_process_vrf_vni_cmd(zvrf, vni, err, ERR_STR_SZ, 0); if (ret != 0) { vty_out(vty, "%s\n", err); return CMD_WARNING; @@ -2339,6 +2339,8 @@ DEFUN (vrf_vni_mapping, assert(vrf); assert(zvrf); + /* Mark as having FRR configuration */ + vrf_set_user_cfged(vrf); ret = zebra_vxlan_process_vrf_vni_cmd(zvrf, vni, err, ERR_STR_SZ, 1); if (ret != 0) { vty_out(vty, "%s\n", err); diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index c05abc3528..750dfc4ea8 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3793,7 +3793,7 @@ static int ip_prefix_send_to_client(vrf_id_t vrf_id, struct stream *s = NULL; char buf[PREFIX_STRLEN]; - client = zebra_find_client(ZEBRA_ROUTE_BGP); + client = zebra_find_client(ZEBRA_ROUTE_BGP, 0); /* BGP may not be running. */ if (!client) return 0;