diff options
| author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2025-03-26 13:46:17 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-26 13:46:17 -0500 |
| commit | 2f6fb565fc84b98ce1cd88c3b366f0ae18ac423b (patch) | |
| tree | 7017df7dd50868b663a8573497d2f66a066adcc1 | |
| parent | 1248e0d4560d1048db2d66f0753b02099ee67130 (diff) | |
| parent | d35493ad517c1485b43bebddf398dfcdb13e0177 (diff) | |
Merge pull request #18510 from FRRouting/mergify/bp/stable/10.2/pr-18503
ospf6d: Fix LSA memory leaks related to graceful restart (backport #18503)
| -rw-r--r-- | ospf6d/ospf6_flood.c | 1 | ||||
| -rw-r--r-- | ospf6d/ospf6_gr.c | 1 | ||||
| -rwxr-xr-x | tests/topotests/ospf6_gr_topo1/test_ospf6_gr_topo1.py | 22 |
3 files changed, 13 insertions, 11 deletions
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index 04ff35083f..261eed30ea 100644 --- a/ospf6d/ospf6_flood.c +++ b/ospf6d/ospf6_flood.c @@ -1061,6 +1061,7 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from, zlog_debug( "%s, Not moving to HELPER role, So dicarding GraceLSA", __func__); + ospf6_lsa_delete(new); return; } } diff --git a/ospf6d/ospf6_gr.c b/ospf6d/ospf6_gr.c index 64eb90d5f2..27b8df0828 100644 --- a/ospf6d/ospf6_gr.c +++ b/ospf6d/ospf6_gr.c @@ -371,6 +371,7 @@ void ospf6_gr_check_lsdb_consistency(struct ospf6 *ospf6, snprintfrr(reason, sizeof(reason), "detected inconsistent LSA %s [area %pI4]", lsa->name, &area->area_id); + ospf6_lsa_unlock(&lsa); ospf6_gr_restart_exit(ospf6, reason); return; } diff --git a/tests/topotests/ospf6_gr_topo1/test_ospf6_gr_topo1.py b/tests/topotests/ospf6_gr_topo1/test_ospf6_gr_topo1.py index ba705e3dfc..a5715e6d88 100755 --- a/tests/topotests/ospf6_gr_topo1/test_ospf6_gr_topo1.py +++ b/tests/topotests/ospf6_gr_topo1/test_ospf6_gr_topo1.py @@ -17,14 +17,14 @@ test_ospf6_gr_topo1.py: | 1.1.1.1 | +---------+ |eth-rt2 - | + |area 1 |eth-rt1 +---------+ | RT2 | | 2.2.2.2 | +---------+ |eth-rt3 - | + |area 0 |eth-rt2 +---------+ | RT3 | @@ -33,14 +33,14 @@ test_ospf6_gr_topo1.py: eth-rt4| |eth-rt6 | | +---------+ +--------+ - | | + |area 0 |area 0 |eth-rt3 |eth-rt3 +---------+ +---------+ | RT4 | | RT6 | | 4.4.4.4 | | 6.6.6.6 | +---------+ +---------+ |eth-rt5 |eth-rt7 - | | + |area 2 |area 3 |eth-rt4 |eth-rt6 +---------+ +---------+ | RT5 | | RT7 | @@ -153,7 +153,7 @@ def router_compare_json_output(rname, command, reference, tries): expected = json.loads(open(filename).read()) test_func = partial(topotest.router_json_cmp, tgen.gears[rname], command, expected) - _, diff = topotest.run_and_expect(test_func, None, count=tries, wait=0.5) + _, diff = topotest.run_and_expect(test_func, None, count=tries, wait=1) assertmsg = '"{}" JSON output mismatches the expected result'.format(rname) assert diff is None, assertmsg @@ -206,12 +206,12 @@ def check_routers(initial_convergence=False, exiting=None, restarting=None): # processing it. Let's give it a few seconds to allow this to happen # under load. if initial_convergence == True: - tries = 240 + tries = 120 else: if restarting != None: - tries = 40 + tries = 20 else: - tries = 10 + tries = 15 router_compare_json_output( rname, "show ipv6 route ospf json", "show_ipv6_route.json", tries ) @@ -219,7 +219,7 @@ def check_routers(initial_convergence=False, exiting=None, restarting=None): # Check that all adjacencies are up and running (except when there's # an OSPF instance that is shutting down). if exiting == None: - tries = 240 + tries = 120 router_compare_json_output( rname, "show ipv6 ospf neighbor json", @@ -231,9 +231,9 @@ def check_routers(initial_convergence=False, exiting=None, restarting=None): # In the restarting router, wait up to one minute for the LSDB to converge. if exiting != rname: if initial_convergence == True or restarting == rname: - tries = 240 + tries = 120 else: - tries = 10 + tries = 15 router_compare_json_output( rname, "show ipv6 ospf database json", |
