]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra/bgpd: fix compilation issues
authormitesh <mitesh@cumulusnetworks.com>
Thu, 18 Jan 2018 18:27:26 +0000 (10:27 -0800)
committermitesh <mitesh@cumulusnetworks.com>
Wed, 24 Jan 2018 00:30:40 +0000 (16:30 -0800)
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
bgpd/bgp_evpn.c
bgpd/bgp_route.c
bgpd/rfapi/rfapi.c
bgpd/rfapi/rfapi_import.c
bgpd/rfapi/rfapi_rib.c
bgpd/rfapi/rfapi_vty.c
bgpd/rfapi/vnc_export_bgp.c
bgpd/rfapi/vnc_import_bgp.c
zebra/zebra_vty.c
zebra/zebra_vxlan.c

index 438b29b4ef4fb519e5776d01ceda6e5ae44aefc6..8ad8dc8ee21fb2013db17463f1c5c9160efad8ea 100644 (file)
@@ -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)),
index 5ed1b424078cae872b58eadacd4edb228556d49a..36e0c92482a832d29bc5156fd737812968d7b1a6 100644 (file)
@@ -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. */
index 95666143a5c5a9723e70f789d59e52193f8c0487..9d169eed32c571e1f6aaaef43df8b44270c657cd 100644 (file)
@@ -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 */
 
index 8727c5d5ea5c20a1bb1eae186387df7ffd2935af..e1508dbd83bd0e858f7d50b7bf0ccc7366b407ca 100644 (file)
@@ -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 */
index bd79518bfd75c7caa2d4d19d39508faf8ddaed49..271c74851018c9bb34b0592e5db57f61639450cd 100644 (file)
@@ -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 */
index 37ca5edc96dfde0b2532c584a98e0f18f1586983..36100d5429357cb5be1cfd1e9f21b21a579eee92 100644 (file)
@@ -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)
index a37e7056126028244ce7024dac9cb4b3109446b2..e88dd9399c565b01d6711e5c9222827b51fd89de 100644 (file)
@@ -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 */
                        }
index f7e86123b4f3422a5e4f372b9e9d30a6c2240c94..cfa4c599f2a1a44c4470fe163d9ae30c11949b7c 100644 (file)
@@ -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;
 
index fc4e37f0f964f121923f80bcc071232adc0f7753..bc6a18d3b532f182f8503414391ec58317acce1c 100644 (file)
@@ -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);
index c05abc3528c7cec17502e8960fdb6ee6442b6961..750dfc4ea8b489a7a47553767634608835b83830 100644 (file)
@@ -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;