From: Donald Sharp Date: Wed, 17 Oct 2018 15:31:34 +0000 (-0400) Subject: bgpd: Cleanup bnch_nexthop_cache_reset to fit cleaner X-Git-Tag: frr-7.1-dev~262^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=3d111939f27558e329a34eb1dc1c5e609a2369c6;p=matthieu%2Ffrr.git bgpd: Cleanup bnch_nexthop_cache_reset to fit cleaner Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index be219d2374..453afea24c 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -84,18 +84,18 @@ static void bgp_nexthop_cache_reset(struct bgp_table *table) for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) { bnc = bgp_nexthop_get_node_info(rn); - if (bnc != NULL) { - while (!LIST_EMPTY(&(bnc->paths))) { - struct bgp_path_info *path = - LIST_FIRST(&(bnc->paths)); + if (!bnc) + continue; - path_nh_map(path, bnc, false); - } + while (!LIST_EMPTY(&(bnc->paths))) { + struct bgp_path_info *path = LIST_FIRST(&(bnc->paths)); - bnc_free(bnc); - bgp_nexthop_set_node_info(rn, NULL); - bgp_unlock_node(rn); + path_nh_map(path, bnc, false); } + + bnc_free(bnc); + bgp_nexthop_set_node_info(rn, NULL); + bgp_unlock_node(rn); } }