From 2de1475ffedc2303fb0f3ff00803bab3d327f1cd Mon Sep 17 00:00:00 2001 From: Daniel Walton Date: Wed, 5 Oct 2016 20:54:55 +0000 Subject: [PATCH] some rfapi compile fixes Signed-off-by: Daniel Walton --- bgpd/bgp_attr.c | 2 +- bgpd/bgp_mplsvpn.c | 2 +- bgpd/rfapi/.gitignore | 1 + bgpd/rfapi/rfapi.c | 19 ------------------- bgpd/rfapi/rfapi_import.c | 4 ---- bgpd/rfapi/rfapi_rib.c | 4 ---- bgpd/rfapi/rfapi_vty.c | 9 --------- bgpd/rfapi/vnc_import_bgp.c | 28 ---------------------------- bgpd/rfapi/vnc_zebra.c | 8 ++------ 9 files changed, 5 insertions(+), 72 deletions(-) create mode 100644 bgpd/rfapi/.gitignore diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index f5daf607e6..b1388d0c4e 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -1952,7 +1952,7 @@ bgp_attr_encap( bgp_size_t total; struct attr_extra *attre = NULL; struct bgp_attr_encap_subtlv *stlv_last = NULL; - uint16_t tunneltype; + uint16_t tunneltype = 0; total = length + (CHECK_FLAG (flag, BGP_ATTR_FLAG_EXTLEN) ? 4 : 3); diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index e3e28c7a0f..2fc5d28087 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -125,7 +125,7 @@ decode_rd_ip (u_char *pnt, struct rd_ip *rd_ip) #if ENABLE_BGP_VNC /* type == RD_TYPE_VNC_ETH */ -void +static void decode_rd_vnc_eth (u_char *pnt, struct rd_vnc_eth *rd_vnc_eth) { rd_vnc_eth->type = RD_TYPE_VNC_ETH; diff --git a/bgpd/rfapi/.gitignore b/bgpd/rfapi/.gitignore new file mode 100644 index 0000000000..0638d7514b --- /dev/null +++ b/bgpd/rfapi/.gitignore @@ -0,0 +1 @@ +.dirstamp diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index e33c33aa76..3e292716de 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -1873,7 +1873,6 @@ rfapi_open_rfd (struct rfapi_descriptor *rfd, struct bgp *bgp) struct rfapi_nve_group_cfg *rfg; struct rfapi *h; struct rfapi_cfg *hc; - struct prefix_rd prd; int rc; h = bgp->rfapi; @@ -1914,14 +1913,6 @@ rfapi_open_rfd (struct rfapi_descriptor *rfd, struct bgp *bgp) return rc; } - - /* - * Construct route distinguisher for VPN routes - */ - prd = rfd->rd; - prd.family = AF_UNSPEC; - prd.prefixlen = 64; - /* * re-advertise registered routes, this time as part of new NVE-group */ @@ -2316,7 +2307,6 @@ rfapi_close (void *handle) struct route_node *node; struct bgp *bgp; struct rfapi *h; - struct rfapi_cfg *hc; zlog_debug ("%s: rfd=%p", __func__, rfd); @@ -2366,8 +2356,6 @@ rfapi_close (void *handle) return 0; } - hc = bgp->rfapi_cfg; - if (CHECK_FLAG (rfd->flags, RFAPI_HD_FLAG_CLOSING_ADMINISTRATIVELY)) { @@ -2478,7 +2466,6 @@ int rfapi_reopen (struct rfapi_descriptor *rfd, struct bgp *bgp) { struct rfapi *h; - struct rfapi_cfg *hc; int rc; if ((rc = rfapi_close_inner (rfd, bgp))) @@ -2489,7 +2476,6 @@ rfapi_reopen (struct rfapi_descriptor *rfd, struct bgp *bgp) { h = bgp->rfapi; - hc = bgp->rfapi_cfg; assert (!CHECK_FLAG (h->flags, RFAPI_INCALLBACK)); @@ -2538,7 +2524,6 @@ rfapi_register ( uint32_t *label = NULL; struct rfapi_vn_option *vo; struct rfapi_l2address_option *l2o = NULL; - struct rfapi_nexthop *lnh = NULL; struct prefix_rd *prd_override = NULL; switch (action) @@ -2566,10 +2551,6 @@ rfapi_register ( { l2o = &vo->v.l2addr; } - if (RFAPI_VN_OPTION_TYPE_LOCAL_NEXTHOP == vo->type) - { - lnh = &vo->v.local_nexthop; - } if (RFAPI_VN_OPTION_TYPE_INTERNAL_RD == vo->type) { prd_override = &vo->v.internal_rd; diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index 110182a1fc..8783024f16 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -3731,8 +3731,6 @@ rfapiBgpInfoFilteredImportVPN ( } else { - int washolddown = 0; - zlog_debug ("%s: %s at prefix %s/%d", __func__, ((action == @@ -3757,8 +3755,6 @@ rfapiBgpInfoFilteredImportVPN ( import_table->holddown_count[afi] -= 1; RFAPI_UPDATE_ITABLE_COUNT (bi, import_table, afi, 1); - - washolddown = 1; } /* * decrement remote count (if route is remote) because diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c index 48c2d422d9..62ffd7b820 100644 --- a/bgpd/rfapi/rfapi_rib.c +++ b/bgpd/rfapi/rfapi_rib.c @@ -1069,12 +1069,8 @@ process_pending_node ( * then remove from pending list because the route * hasn't changed. */ - int same = 0; if (!rfapi_info_cmp (ori, ri)) { - /* same: delete from pending list */ - same = 1; - skiplist_delete (slPendPt, &ri->rk, NULL); assert (lPendCost); if (lPendCost) diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index 0cb6f31ac1..3c76bb4223 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -1142,9 +1142,6 @@ rfapiPrintRemoteRegBi ( struct vty *vty; void *out; const char *vty_newline; - - uint32_t factor; - struct prefix pfx_un; struct prefix pfx_vn; uint8_t cost; @@ -1158,12 +1155,6 @@ rfapiPrintRemoteRegBi ( char buf_lifetime[BUFSIZ]; int nlines = 0; - if (bgp && bgp->rfapi_cfg) - factor = bgp->rfapi_cfg->rfp_cfg.holddown_factor; - else - factor = RFAPI_RFP_CFG_DEFAULT_HOLDDOWN_FACTOR; - - if (!stream) return 0; /* for debug log, print into buf & call output once */ diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c index 79ef92e1f5..99ec9efb26 100644 --- a/bgpd/rfapi/vnc_import_bgp.c +++ b/bgpd/rfapi/vnc_import_bgp.c @@ -952,7 +952,6 @@ vnc_import_bgp_add_route_mode_nvegroup (struct bgp *bgp, struct prefix_rd prd; struct route_map *rmap = NULL; uint32_t local_pref; - uint32_t *med = NULL; { char buf[BUFSIZ]; @@ -1120,12 +1119,6 @@ vnc_import_bgp_add_route_mode_nvegroup (struct bgp *bgp, local_pref = calc_local_pref (iattr, peer); - if (iattr && (iattr->flag & ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC))) - { - - med = &iattr->med; - } - if (VNC_DEBUG(IMPORT_BGP_ADD_ROUTE)) { char buf[BUFSIZ]; @@ -1334,9 +1327,6 @@ vnc_import_bgp_del_route_mode_resolve_nve_one_bi ( struct prefix *prefix)/* unicast route prefix */ { struct prefix un; - uint32_t lifetime; - uint32_t *plifetime; - struct bgp_attr_encap_subtlv *encaptlvs; if (bi->type != ZEBRA_ROUTE_BGP && bi->type != ZEBRA_ROUTE_BGP_DIRECT) { @@ -1363,24 +1353,6 @@ vnc_import_bgp_del_route_mode_resolve_nve_one_bi ( memset (&vncHDResolveNve.un_addr, 0, sizeof (vncHDResolveNve.un_addr)); } - if (rfapiGetVncLifetime (bi->attr, &lifetime)) - { - plifetime = NULL; - } - else - { - plifetime = &lifetime; - } - - if (bi->attr && bi->attr->extra) - { - encaptlvs = bi->attr->extra->vnc_subtlvs; - } - else - { - encaptlvs = NULL; - } - del_vnc_route (&vncHDResolveNve, vncHDResolveNve.peer, bgp, SAFI_MPLS_VPN, prefix, /* unicast route prefix */ prd, ZEBRA_ROUTE_BGP_DIRECT, BGP_ROUTE_REDISTRIBUTE, NULL, 0); /* flags */ diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c index 0ea0fa9e50..e357ef6eff 100644 --- a/bgpd/rfapi/vnc_zebra.c +++ b/bgpd/rfapi/vnc_zebra.c @@ -348,12 +348,10 @@ vnc_zebra_read_ipv4 ( { struct stream *s; struct zapi_ipv4 api; - unsigned long ifindex; struct in_addr nexthop; struct prefix_ipv4 p; s = zclient->ibuf; - ifindex = 0; nexthop.s_addr = 0; /* Type, flags, message. */ @@ -376,7 +374,7 @@ vnc_zebra_read_ipv4 ( if (CHECK_FLAG (api.message, ZAPI_MESSAGE_IFINDEX)) { api.ifindex_num = stream_getc (s); - ifindex = stream_getl (s); + stream_getl (s); } if (CHECK_FLAG (api.message, ZAPI_MESSAGE_DISTANCE)) api.distance = stream_getc (s); @@ -433,12 +431,10 @@ vnc_zebra_read_ipv6 ( { struct stream *s; struct zapi_ipv6 api; - unsigned long ifindex; struct in6_addr nexthop; struct prefix_ipv6 p; s = zclient->ibuf; - ifindex = 0; memset (&nexthop, 0, sizeof (struct in6_addr)); /* Type, flags, message. */ @@ -461,7 +457,7 @@ vnc_zebra_read_ipv6 ( if (CHECK_FLAG (api.message, ZAPI_MESSAGE_IFINDEX)) { api.ifindex_num = stream_getc (s); - ifindex = stream_getl (s); + stream_getl (s); } if (CHECK_FLAG (api.message, ZAPI_MESSAGE_DISTANCE)) api.distance = stream_getc (s); -- 2.39.5