diff --git a/bfdd/bfd.c b/bfdd/bfd.c index 90287114fc..d2b60100e1 100644 --- a/bfdd/bfd.c +++ b/bfdd/bfd.c @@ -159,6 +159,7 @@ int bfd_session_enable(struct bfd_session *bs) bs->vrf = vrf; if (bs->vrf == NULL) bs->vrf = vrf_lookup_by_id(VRF_DEFAULT); + assert(bs->vrf); if (bs->key.ifname[0] && BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_MH) == 0) diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c index 7fbe6db163..ed36bb742e 100644 --- a/bfdd/bfd_packet.c +++ b/bfdd/bfd_packet.c @@ -529,8 +529,7 @@ int bfd_recv_cb(struct thread *t) uint8_t msgbuf[1516]; struct bfd_vrf_global *bvrf = THREAD_ARG(t); - if (bvrf) - vrfid = bvrf->vrf->vrf_id; + vrfid = bvrf->vrf->vrf_id; /* Schedule next read. */ bfd_sd_reschedule(bvrf, sd); diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c index 648c3be47e..d37bf54734 100644 --- a/bgpd/bgp_mpath.c +++ b/bgpd/bgp_mpath.c @@ -614,8 +614,6 @@ void bgp_path_info_mpath_update(struct bgp_node *rn, if ((mpath_count < maxpaths) && (new_mpath != new_best) && bgp_path_info_nexthop_cmp(prev_mpath, new_mpath)) { - if (new_mpath == next_mpath) - bgp_path_info_mpath_next(new_mpath); bgp_path_info_mpath_dequeue(new_mpath); bgp_path_info_mpath_enqueue(prev_mpath, diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index de4f185ab2..af73a3afc4 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -7241,21 +7241,11 @@ void route_vty_out(struct vty *vty, struct prefix *p, if (json_paths) { json_nexthop_global = json_object_new_object(); - if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_EVPN)) - json_object_string_add( - json_nexthop_global, - nexthop_fqdn ? "fqdn" : "ip", - nexthop_fqdn - ? nexthop_fqdn - : inet_ntoa( - attr->mp_nexthop_global_in)); - else - json_object_string_add( - json_nexthop_global, - nexthop_fqdn ? "fqdn" : "ip", - nexthop_fqdn - ? nexthop_fqdn - : inet_ntoa(attr->nexthop)); + json_object_string_add(json_nexthop_global, + nexthop_fqdn ? "fqdn" : "ip", + nexthop_fqdn + ? nexthop_fqdn + : inet_ntoa(attr->nexthop)); json_object_string_add(json_nexthop_global, "afi", "ipv4"); diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 1a3fa2c921..a2d4c0101e 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -7530,7 +7530,6 @@ static void bgp_config_write_family(struct vty *vty, struct bgp *bgp, afi_t afi, int bgp_config_write(struct vty *vty) { - int write = 0; struct bgp *bgp; struct peer_group *group; struct peer *peer; @@ -7541,9 +7540,6 @@ int bgp_config_write(struct vty *vty) vty_out(vty, "bgp route-map delay-timer %u\n", bm->rmap_update_timer); - if (write) - vty_out(vty, "!\n"); - /* BGP configuration. */ for (ALL_LIST_ELEMENTS(bm->bgp, mnode, mnnode, bgp)) { 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;