From c7e803f1f4c99094b19ffee8c9d5504678f52784 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 25 Oct 2019 20:31:02 -0400 Subject: [PATCH] bgpd: Remove dead code in rfapi Coverity spotted some dead code in the rfapi code. Removing. Signed-off-by: Donald Sharp --- bgpd/rfapi/rfapi.c | 8 ++------ bgpd/rfapi/rfapi_vty.c | 2 -- bgpd/rfapi/vnc_import_bgp.c | 2 -- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index 83b05ce536..7c4f8eaa01 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -3190,12 +3190,8 @@ DEFUN (debug_rfapi_register_vn_un_l2o, return CMD_WARNING_CONFIG_FAILED; } optary[opt_next].type = RFAPI_VN_OPTION_TYPE_L2ADDR; - if (opt_next) { - optary[opt_next - 1].next = optary + opt_next; - } else { - opt = optary; - } - ++opt_next; + opt = optary; + /* L2 option parsing END */ /* TBD fixme */ diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index dc4a02e8b2..4fa64075c4 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -4708,8 +4708,6 @@ static int vnc_add_vrf_prefix(struct vty *vty, const char *arg_vrf, rfapiQprefix2Rprefix(&pfx, &rpfx); memset(optary, 0, sizeof(optary)); if (arg_rd) { - if (opt != NULL) - opt->next = &optary[cur_opt]; opt = &optary[cur_opt++]; opt->type = RFAPI_VN_OPTION_TYPE_INTERNAL_RD; if (!str2prefix_rd(arg_rd, &opt->v.internal_rd)) { diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c index 51ec999764..df06105535 100644 --- a/bgpd/rfapi/vnc_import_bgp.c +++ b/bgpd/rfapi/vnc_import_bgp.c @@ -479,8 +479,6 @@ static void vnc_import_bgp_add_route_mode_resolve_nve_one_bi( encaptlvs = bpi->attr->vnc_subtlvs; if (bpi->attr->encap_tunneltype != BGP_ENCAP_TYPE_RESERVED && bpi->attr->encap_tunneltype != BGP_ENCAP_TYPE_MPLS) { - if (opt != NULL) - opt->next = &optary[cur_opt]; opt = &optary[cur_opt++]; memset(opt, 0, sizeof(struct rfapi_un_option)); opt->type = RFAPI_UN_OPTION_TYPE_TUNNELTYPE; -- 2.39.5