From 4f28b2b59e4a203e84aab230e285665ad1a4360e Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 14 Nov 2020 16:29:16 -0500 Subject: [PATCH 01/10] bgpd: When showing a lcommunity free alloced memory We are temporarily allocing memory to show lcommunity information. We then immediately drop it. Account for that memory properly. Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 9873057fa2..1be7e4844d 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -11206,6 +11206,7 @@ static int bgp_show_lcommunity(struct vty *vty, struct bgp *bgp, int argc, char *str; int first = 0; uint8_t show_flags = 0; + int ret; if (uj) SET_FLAG(show_flags, BGP_SHOW_OPT_JSON); @@ -11233,10 +11234,13 @@ static int bgp_show_lcommunity(struct vty *vty, struct bgp *bgp, int argc, return CMD_WARNING; } - return bgp_show(vty, bgp, afi, safi, + ret = bgp_show(vty, bgp, afi, safi, (exact ? bgp_show_type_lcommunity_exact : bgp_show_type_lcommunity), lcom, show_flags); + + lcommunity_free(&lcom); + return ret; } static int bgp_show_lcommunity_list(struct vty *vty, struct bgp *bgp, From 8affc28e918f522b93f3a6ab76917501daf82ae8 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 14 Nov 2020 17:31:21 -0500 Subject: [PATCH 02/10] bfdd: On interface address delete we are leaking memory The interface address delete callback from zebra was not deleting the ifc that was created as per normal work methodologies Signed-off-by: Donald Sharp --- bfdd/ptm_adapter.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bfdd/ptm_adapter.c b/bfdd/ptm_adapter.c index 3a80d9203b..d3d54c1780 100644 --- a/bfdd/ptm_adapter.c +++ b/bfdd/ptm_adapter.c @@ -794,7 +794,10 @@ static int bfdd_interface_address_update(ZAPI_CALLBACK_ARGS) : "delete", ifc->address); - bfdd_sessions_enable_address(ifc); + if (cmd == ZEBRA_INTERFACE_ADDRESS_ADD) + bfdd_sessions_enable_address(ifc); + else + connected_free(&ifc); return 0; } From 8f15843bba7b0e0fef6479a4447ee333be3ea9e8 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 14 Nov 2020 17:32:01 -0500 Subject: [PATCH 03/10] isisd: On shutdown leaking spf_timer thread data When isis is being shutdown the area->spf_timer thread has special data assigned to that was never being freed. Free this data. Signed-off-by: Donald Sharp --- isisd/isis_spf.c | 5 +++++ isisd/isis_spf.h | 1 + isisd/isisd.c | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 5480a1b339..19cacde4fe 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -1727,6 +1727,11 @@ static struct isis_spf_run *isis_run_spf_arg(struct isis_area *area, int level) return run; } +void isis_spf_timer_free(void *run) +{ + XFREE(MTYPE_ISIS_SPF_RUN, run); +} + int _isis_spf_schedule(struct isis_area *area, int level, const char *func, const char *file, int line) { diff --git a/isisd/isis_spf.h b/isisd/isis_spf.h index a9a14fc75e..ad15d3e3c7 100644 --- a/isisd/isis_spf.h +++ b/isisd/isis_spf.h @@ -78,4 +78,5 @@ struct isis_spftree *isis_run_hopcount_spf(struct isis_area *area, uint8_t *sysid, struct isis_spftree *spftree); +void isis_spf_timer_free(void *run); #endif /* _ZEBRA_ISIS_SPF_H */ diff --git a/isisd/isisd.c b/isisd/isisd.c index 057ede0e38..668b60e385 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -442,7 +442,11 @@ void isis_area_destroy(struct isis_area *area) spftree_area_del(area); + if (area->spf_timer[0]) + isis_spf_timer_free(THREAD_ARG(area->spf_timer[0])); thread_cancel(&area->spf_timer[0]); + if (area->spf_timer[1]) + isis_spf_timer_free(THREAD_ARG(area->spf_timer[1])); thread_cancel(&area->spf_timer[1]); spf_backoff_free(area->spf_delay_ietf[0]); @@ -2375,6 +2379,9 @@ static void area_resign_level(struct isis_area *area, int level) } } + if (area->spf_timer[level - 1]) + isis_spf_timer_free(THREAD_ARG(area->spf_timer[level - 1])); + thread_cancel(&area->spf_timer[level - 1]); sched_debug( From 35fb444b7a28f5e8564ae70ea0c01a68b06bf4b4 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 14 Nov 2020 17:33:43 -0500 Subject: [PATCH 04/10] bgpd: on debug esi was not properly setup There exists a code path where the esi would be passed to a debug without the esi being setup with any values causing us to display what ever is on the stack. Signed-off-by: Donald Sharp --- bgpd/bgp_zebra.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 17bb41cb9f..c44e18383e 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -2840,6 +2840,7 @@ static int bgp_zebra_process_local_macip(ZAPI_CALLBACK_ARGS) stream_get(&esi, s, sizeof(esi_t)); } else { state = stream_getl(s); + memset(&esi, 0, sizeof(esi_t)); } bgp = bgp_lookup_by_vrf_id(vrf_id); From 6bdbcbf12f2f629b649f22afba39237c8a5da214 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 14 Nov 2020 17:40:53 -0500 Subject: [PATCH 05/10] bgpd: print prefix instead of unininted buf The recent change to use %pFX missed a code path where we were displaying a buf that was uninited. Display the prefix as intended. Signed-off-by: Donald Sharp --- bgpd/bgp_zebra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index c44e18383e..0f8168c89e 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -531,9 +531,9 @@ static int zebra_read_route(ZAPI_CALLBACK_ARGS) api.instance, &api.prefix, buf, nhtype, ifindex, api.metric, api.tag); } else { - zlog_debug("Rx route DEL VRF %u %s[%d] %s", vrf_id, + zlog_debug("Rx route DEL VRF %u %s[%d] %pFX", vrf_id, zebra_route_string(api.type), api.instance, - buf); + &api.prefix); } } From d53e72e5942291eb8c1b81ae6dcb320ef6194ec6 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 14 Nov 2020 17:58:40 -0500 Subject: [PATCH 06/10] isisd: Free created tables On redistribution into isis we were creating a table for handling the redistributed routes, but never cleaning them up on shutdown properly. Do so. Signed-off-by: Donald Sharp --- isisd/isis_redist.c | 13 +++++++++++++ isisd/isis_redist.h | 1 + isisd/isisd.c | 1 + 3 files changed, 15 insertions(+) diff --git a/isisd/isis_redist.c b/isisd/isis_redist.c index e6c7a734bd..5714fa872a 100644 --- a/isisd/isis_redist.c +++ b/isisd/isis_redist.c @@ -380,6 +380,19 @@ static void isis_redist_update_zebra_subscriptions(struct isis *isis) } } +void isis_redist_free(struct isis *isis) +{ + int i; + + for (i = 0; i < REDIST_PROTOCOL_COUNT; i++) { + if (!isis->ext_info[i]) + continue; + + route_table_finish(isis->ext_info[i]); + isis->ext_info[i] = NULL; + } +} + void isis_redist_set(struct isis_area *area, int level, int family, int type, uint32_t metric, const char *routemap, int originate_type) { diff --git a/isisd/isis_redist.h b/isisd/isis_redist.h index 0d2dc6a803..afce922240 100644 --- a/isisd/isis_redist.h +++ b/isisd/isis_redist.h @@ -62,4 +62,5 @@ void isis_redist_set(struct isis_area *area, int level, int family, int type, uint32_t metric, const char *routemap, int originate_type); void isis_redist_unset(struct isis_area *area, int level, int family, int type); +void isis_redist_free(struct isis *isis); #endif diff --git a/isisd/isisd.c b/isisd/isisd.c index 668b60e385..950cdc281f 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -587,6 +587,7 @@ void isis_finish(struct isis *isis) isis_vrf_unlink(isis, vrf); } + isis_redist_free(isis); list_delete(&isis->area_list); list_delete(&isis->init_circ_list); XFREE(MTYPE_ISIS, isis); From 3d1c148b07c7c81e98fd3059100bd84ba92c4546 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 14 Nov 2020 18:35:21 -0500 Subject: [PATCH 07/10] bgpd: If using filters free up name on peer deletion FRR was not properly deleting the aname and cnmae memory that was allocated if bgp is using filters. Signed-off-by: Donald Sharp --- bgpd/bgpd.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 26c4579013..b773c16b57 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -1094,6 +1094,15 @@ static void peer_free(struct peer *peer) bgp_delete_connected_nexthop(family2afi(peer->su.sa.sa_family), peer); + FOREACH_AFI_SAFI (afi, safi) { + if (peer->filter[afi][safi].advmap.aname) + XFREE(MTYPE_BGP_FILTER_NAME, + peer->filter[afi][safi].advmap.aname); + if (peer->filter[afi][safi].advmap.cname) + XFREE(MTYPE_BGP_FILTER_NAME, + peer->filter[afi][safi].advmap.cname); + } + XFREE(MTYPE_PEER_TX_SHUTDOWN_MSG, peer->tx_shutdown_message); XFREE(MTYPE_PEER_DESC, peer->desc); @@ -1121,12 +1130,8 @@ static void peer_free(struct peer *peer) bfd_info_free(&(peer->bfd_info)); - for (afi = AFI_IP; afi < AFI_MAX; afi++) { - for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { - bgp_addpath_set_peer_type(peer, afi, safi, - BGP_ADDPATH_NONE); - } - } + FOREACH_AFI_SAFI (afi, safi) + bgp_addpath_set_peer_type(peer, afi, safi, BGP_ADDPATH_NONE); bgp_unlock(peer->bgp); From f18ba3cd18210fceac80fc1bf21fcb116d4d4397 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 14 Nov 2020 18:50:37 -0500 Subject: [PATCH 08/10] bgpd, lib, staticd, tests: Convert to using FOREACH_AFI_SAFI Move the FOREACH_AFI_SAFI macro from bgpd.h to zebra.h( GLOBAL's YOUALL ) Then convert all the places that have the two level for loop to iterate over all afi/safis Signed-off-by: Donald Sharp --- bgpd/bgp_addpath.c | 12 +++---- bgpd/bgp_packet.c | 21 ++++++------ bgpd/bgpd.h | 4 --- lib/zebra.h | 4 +++ staticd/static_routes.c | 49 ++++++++++++---------------- staticd/static_vrf.c | 14 ++++---- tests/bgpd/test_mpath.c | 71 +++++++++++++++++++---------------------- 7 files changed, 78 insertions(+), 97 deletions(-) diff --git a/bgpd/bgp_addpath.c b/bgpd/bgp_addpath.c index d07d41bef8..d822f6e330 100644 --- a/bgpd/bgp_addpath.c +++ b/bgpd/bgp_addpath.c @@ -80,14 +80,12 @@ void bgp_addpath_init_bgp_data(struct bgp_addpath_bgp_data *d) afi_t afi; int i; - for (afi = AFI_IP; afi < AFI_MAX; afi++) { - for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { - for (i = 0; i < BGP_ADDPATH_MAX; i++) { - d->id_allocators[afi][safi][i] = NULL; - d->peercount[afi][safi][i] = 0; - } - d->total_peercount[afi][safi] = 0; + FOREACH_AFI_SAFI (afi, safi) { + for (i = 0; i < BGP_ADDPATH_MAX; i++) { + d->id_allocators[afi][safi][i] = NULL; + d->peercount[afi][safi][i] = 0; } + d->total_peercount[afi][safi] = 0; } } diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index a23acda0a8..3d73e34235 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -279,18 +279,17 @@ static void bgp_update_explicit_eors(struct peer *peer) if (bgp_debug_neighbor_events(peer)) zlog_debug("Peer %s: Checking explicit EORs", peer->host); - for (afi = AFI_IP; afi < AFI_MAX; afi++) - for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { - if (peer->afc_nego[afi][safi] - && !CHECK_FLAG(peer->af_sflags[afi][safi], - PEER_STATUS_EOR_RECEIVED)) { - if (bgp_debug_neighbor_events(peer)) - zlog_debug( - " afi %d safi %d didn't receive EOR", - afi, safi); - return; - } + FOREACH_AFI_SAFI (afi, safi) { + if (peer->afc_nego[afi][safi] + && !CHECK_FLAG(peer->af_sflags[afi][safi], + PEER_STATUS_EOR_RECEIVED)) { + if (bgp_debug_neighbor_events(peer)) + zlog_debug( + " afi %d safi %d didn't receive EOR", + afi, safi); + return; } + } peer->update_delay_over = 1; peer->bgp->explicit_eors++; diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index a2a3f374e2..d22fd008d8 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -104,10 +104,6 @@ enum bgp_af_index { #define AF_FOREACH(af) for ((af) = BGP_AF_START; (af) < BGP_AF_MAX; (af)++) -#define FOREACH_AFI_SAFI(afi, safi) \ - for (afi = AFI_IP; afi < AFI_MAX; afi++) \ - for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) - #define FOREACH_SAFI(safi) \ for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) diff --git a/lib/zebra.h b/lib/zebra.h index 14d66d6627..ded44ac636 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -359,6 +359,10 @@ typedef enum { SAFI_MAX = 8 } safi_t; +#define FOREACH_AFI_SAFI(afi, safi) \ + for (afi = AFI_IP; afi < AFI_MAX; afi++) \ + for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) + /* Default Administrative Distance of each protocol. */ #define ZEBRA_KERNEL_DISTANCE_DEFAULT 0 #define ZEBRA_CONNECT_DISTANCE_DEFAULT 0 diff --git a/staticd/static_routes.c b/staticd/static_routes.c index 94299e0980..05355c48fe 100644 --- a/staticd/static_routes.c +++ b/staticd/static_routes.c @@ -546,19 +546,15 @@ void static_fixup_vrf_ids(struct static_vrf *enable_svrf) svrf = vrf->info; /* Install any static routes configured for this VRF. */ - for (afi = AFI_IP; afi < AFI_MAX; afi++) { - for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { - stable = svrf->stable[afi][safi]; - if (!stable) - continue; + FOREACH_AFI_SAFI (afi, safi) { + stable = svrf->stable[afi][safi]; + if (!stable) + continue; - static_fixup_vrf(enable_svrf, stable, - afi, safi); + static_fixup_vrf(enable_svrf, stable, afi, safi); - if (enable_svrf == svrf) - static_enable_vrf(svrf, stable, - afi, safi); - } + if (enable_svrf == svrf) + static_enable_vrf(svrf, stable, afi, safi); } } } @@ -649,20 +645,17 @@ void static_cleanup_vrf_ids(struct static_vrf *disable_svrf) svrf = vrf->info; /* Uninstall any static routes configured for this VRF. */ - for (afi = AFI_IP; afi < AFI_MAX; afi++) { - for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { - struct route_table *stable; + FOREACH_AFI_SAFI (afi, safi) { + struct route_table *stable; - stable = svrf->stable[afi][safi]; - if (!stable) - continue; + stable = svrf->stable[afi][safi]; + if (!stable) + continue; - static_cleanup_vrf(disable_svrf, stable, - afi, safi); + static_cleanup_vrf(disable_svrf, stable, afi, safi); - if (disable_svrf == svrf) - static_disable_vrf(stable, afi, safi); - } + if (disable_svrf == svrf) + static_disable_vrf(stable, afi, safi); } } } @@ -725,14 +718,12 @@ void static_install_intf_nh(struct interface *ifp) continue; /* Install any static routes configured for this interface. */ - for (afi = AFI_IP; afi < AFI_MAX; afi++) { - for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { - stable = svrf->stable[afi][safi]; - if (!stable) - continue; + FOREACH_AFI_SAFI (afi, safi) { + stable = svrf->stable[afi][safi]; + if (!stable) + continue; - static_fixup_intf_nh(stable, ifp, afi, safi); - } + static_fixup_intf_nh(stable, ifp, afi, safi); } } } diff --git a/staticd/static_vrf.c b/staticd/static_vrf.c index 5ae3425715..83894e9267 100644 --- a/staticd/static_vrf.c +++ b/staticd/static_vrf.c @@ -238,14 +238,12 @@ int static_vrf_has_config(struct static_vrf *svrf) * NOTE: This is a don't care for the default VRF, but we go through * the motions to keep things consistent. */ - for (afi = AFI_IP; afi < AFI_MAX; afi++) { - for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { - table = svrf->stable[afi][safi]; - if (!table) - continue; - if (route_table_count(table)) - return 1; - } + FOREACH_AFI_SAFI (afi, safi) { + table = svrf->stable[afi][safi]; + if (!table) + continue; + if (route_table_count(table)) + return 1; } return 0; diff --git a/tests/bgpd/test_mpath.c b/tests/bgpd/test_mpath.c index 99fb7b620d..520c460f15 100644 --- a/tests/bgpd/test_mpath.c +++ b/tests/bgpd/test_mpath.c @@ -106,15 +106,13 @@ static struct bgp *bgp_create_fake(as_t *as, const char *name) // bgp->group->cmp = (int (*)(void *, void *)) peer_group_cmp; bgp_evpn_init(bgp); - for (afi = AFI_IP; afi < AFI_MAX; afi++) - for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { - bgp->route[afi][safi] = bgp_table_init(bgp, afi, safi); - bgp->aggregate[afi][safi] = bgp_table_init( - bgp, afi, safi); - bgp->rib[afi][safi] = bgp_table_init(bgp, afi, safi); - bgp->maxpaths[afi][safi].maxpaths_ebgp = MULTIPATH_NUM; - bgp->maxpaths[afi][safi].maxpaths_ibgp = MULTIPATH_NUM; - } + FOREACH_AFI_SAFI (afi, safi) { + bgp->route[afi][safi] = bgp_table_init(bgp, afi, safi); + bgp->aggregate[afi][safi] = bgp_table_init(bgp, afi, safi); + bgp->rib[afi][safi] = bgp_table_init(bgp, afi, safi); + bgp->maxpaths[afi][safi].maxpaths_ebgp = MULTIPATH_NUM; + bgp->maxpaths[afi][safi].maxpaths_ibgp = MULTIPATH_NUM; + } bgp_scan_init(bgp); bgp->default_local_pref = BGP_DEFAULT_LOCAL_PREF; @@ -152,36 +150,33 @@ static int run_bgp_cfg_maximum_paths(testcase_t *t) int test_result = TEST_PASSED; bgp = t->tmp_data; - for (afi = AFI_IP; afi < AFI_MAX; afi++) - for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { - /* test bgp_maximum_paths_set */ - api_result = bgp_maximum_paths_set( - bgp, afi, safi, BGP_PEER_EBGP, 10, 0); - EXPECT_TRUE(api_result == 0, test_result); - api_result = bgp_maximum_paths_set( - bgp, afi, safi, BGP_PEER_IBGP, 10, 0); - EXPECT_TRUE(api_result == 0, test_result); - EXPECT_TRUE(bgp->maxpaths[afi][safi].maxpaths_ebgp - == 10, - test_result); - EXPECT_TRUE(bgp->maxpaths[afi][safi].maxpaths_ibgp - == 10, - test_result); + FOREACH_AFI_SAFI (afi, safi) { + /* test bgp_maximum_paths_set */ + api_result = bgp_maximum_paths_set(bgp, afi, safi, + BGP_PEER_EBGP, 10, 0); + EXPECT_TRUE(api_result == 0, test_result); + api_result = bgp_maximum_paths_set(bgp, afi, safi, + BGP_PEER_IBGP, 10, 0); + EXPECT_TRUE(api_result == 0, test_result); + EXPECT_TRUE(bgp->maxpaths[afi][safi].maxpaths_ebgp == 10, + test_result); + EXPECT_TRUE(bgp->maxpaths[afi][safi].maxpaths_ibgp == 10, + test_result); - /* test bgp_maximum_paths_unset */ - api_result = bgp_maximum_paths_unset(bgp, afi, safi, - BGP_PEER_EBGP); - EXPECT_TRUE(api_result == 0, test_result); - api_result = bgp_maximum_paths_unset(bgp, afi, safi, - BGP_PEER_IBGP); - EXPECT_TRUE(api_result == 0, test_result); - EXPECT_TRUE((bgp->maxpaths[afi][safi].maxpaths_ebgp - == MULTIPATH_NUM), - test_result); - EXPECT_TRUE((bgp->maxpaths[afi][safi].maxpaths_ibgp - == MULTIPATH_NUM), - test_result); - } + /* test bgp_maximum_paths_unset */ + api_result = + bgp_maximum_paths_unset(bgp, afi, safi, BGP_PEER_EBGP); + EXPECT_TRUE(api_result == 0, test_result); + api_result = + bgp_maximum_paths_unset(bgp, afi, safi, BGP_PEER_IBGP); + EXPECT_TRUE(api_result == 0, test_result); + EXPECT_TRUE((bgp->maxpaths[afi][safi].maxpaths_ebgp + == MULTIPATH_NUM), + test_result); + EXPECT_TRUE((bgp->maxpaths[afi][safi].maxpaths_ibgp + == MULTIPATH_NUM), + test_result); + } return test_result; } From ff3bf9a436782dad7549d00f3294cdc65afe48d8 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 14 Nov 2020 19:16:57 -0500 Subject: [PATCH 09/10] bgpd: Free aggr_suppresors list on extra deletion When we delete the bgp_path_info_extra data structure free the aggr_suppressors data structure that was left dangling. Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 1be7e4844d..97e5a7e2dd 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -241,6 +241,9 @@ void bgp_path_info_extra_free(struct bgp_path_info_extra **extra) if (e->bgp_orig) bgp_unlock(e->bgp_orig); + if (e->aggr_suppressors) + list_delete(&e->aggr_suppressors); + if ((*extra)->bgp_fs_iprule) list_delete(&((*extra)->bgp_fs_iprule)); if ((*extra)->bgp_fs_pbr) From 1f3255e5c10a5efde06ad09f8a165bee0c484018 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 14 Nov 2020 21:19:42 -0500 Subject: [PATCH 10/10] babeld: Free ifc leak On removal of an address on an interface babel was not properly cleaning memory. Signed-off-by: Donald Sharp --- babeld/babel_interface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c index ae8b161b01..d37e0b608f 100644 --- a/babeld/babel_interface.c +++ b/babeld/babel_interface.c @@ -187,6 +187,7 @@ babel_interface_address_delete (ZAPI_CALLBACK_ARGS) send_request(ifc->ifp, NULL, 0); send_update(ifc->ifp, 0, NULL, 0); + connected_free(&ifc); return 0; }