Compare commits

..

8 Commits

Author SHA1 Message Date
Yu Watanabe 37de158216
Merge 704d837741 into b7eefa1996 2024-11-21 14:02:38 +09:00
Yu Watanabe 704d837741 network/nexthop: add one more assertion
This may help issue #35164.
2024-11-21 04:33:23 +09:00
Yu Watanabe d70f532b55 network: introduce address_forget() and friends and use it where applicable
No functional change, just refactoring.
2024-11-21 04:33:15 +09:00
Yu Watanabe d64ce1efab network/nexthop: drop outdated comment and add one debugging log
All NextHop objects are managed by Manager since
352eba2e49.
2024-11-21 04:06:53 +09:00
Yu Watanabe f57bac0843 network/ndisc: unref Route objects that depend on the nexthop
No functional change, as when this function is called, the set will be
freed and contained Route objects will be unref()ed anyway soon later
by nexthop_detach() -> nexthop_free().
Even though, when the routes are forgotten from the Manager, then it is
not necessary to keep them by the nexthop. Let's unref earlier.
2024-11-21 04:06:53 +09:00
Yu Watanabe 33a60cd70f network/ndisc: constify several arguments and add several assertions
Follow-up for 0f8afaf94d.

No functional change, just for safety.
2024-11-21 04:06:53 +09:00
Yu Watanabe 1ed373c363 network/nexthop: do not share NextHop.nexthops and NextHop.routes with duplicated object
Otherwise, these may be freed twice.
But, fortunately, when this function is called, both are NULL.
So, this should not change any behavior. But for safety.
2024-11-21 04:06:53 +09:00
Yu Watanabe e656a914ea network: drop outdated comment
All Route objects are managed by Manager since
8d01e44c1f.
2024-11-21 04:06:53 +09:00
1 changed files with 1 additions and 3 deletions

View File

@ -78,9 +78,7 @@ static NextHop* nexthop_detach_impl(NextHop *nexthop) {
nexthop_detach_from_group_members(nexthop);
NextHop *n;
n = hashmap_remove(nexthop->manager->nexthops_by_id, UINT32_TO_PTR(nexthop->id));
assert(!n || n == nexthop);
assert_se(hashmap_remove(nexthop->manager->nexthops_by_id, UINT32_TO_PTR(nexthop->id)) == nexthop);
nexthop->manager = NULL;
return nexthop;
}