mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
network: set 'removing' flag to remembered object
Previously, if address_remove() or friends called with a temporary object, the removing flag is assigned to the temporary object, and is not set to the remembered object. Hence, e.g. route_is_ready_to_configure() wrongly judge a required address for a route is (still) ready, hence networkd fails to configure the route. Fixes #28009.
This commit is contained in:
parent
10aedb6f9d
commit
fe0acbf7e0
@ -1155,6 +1155,9 @@ int address_remove(Address *address, Link *link) {
|
||||
assert(link->manager);
|
||||
assert(link->manager->rtnl);
|
||||
|
||||
/* If the address is remembered, use the remembered object. */
|
||||
(void) address_get(link, address, &address);
|
||||
|
||||
log_address_debug(address, "Removing", link);
|
||||
|
||||
r = sd_rtnl_message_new_addr(link->manager->rtnl, &m, RTM_DELADDR,
|
||||
|
@ -442,6 +442,9 @@ int neighbor_remove(Neighbor *neighbor, Link *link) {
|
||||
assert(link->manager);
|
||||
assert(link->manager->rtnl);
|
||||
|
||||
/* If the neighbor is remembered, then use the remembered object. */
|
||||
(void) neighbor_get(link, neighbor, &neighbor);
|
||||
|
||||
log_neighbor_debug(neighbor, "Removing", link);
|
||||
|
||||
r = sd_rtnl_message_new_neigh(link->manager->rtnl, &m, RTM_DELNEIGH,
|
||||
|
@ -552,6 +552,9 @@ int nexthop_remove(NextHop *nexthop, Manager *manager) {
|
||||
assert(nexthop->id > 0);
|
||||
assert(manager);
|
||||
|
||||
/* If the nexthop is remembered, then use the remembered object. */
|
||||
(void) nexthop_get_by_id(manager, PTR_TO_UINT32(nexthop->id), &nexthop);
|
||||
|
||||
/* link may be NULL. */
|
||||
(void) link_get_by_index(manager, nexthop->ifindex, &link);
|
||||
|
||||
|
@ -575,8 +575,12 @@ int route_remove(Route *route, Manager *manager) {
|
||||
assert(route);
|
||||
assert(manager);
|
||||
|
||||
/* If the route is remembered, then use the remembered object. */
|
||||
(void) route_get(manager, route, &route);
|
||||
|
||||
log_route_debug(route, "Removing", manager);
|
||||
|
||||
/* For logging. */
|
||||
(void) route_get_link(manager, route, &link);
|
||||
|
||||
r = sd_rtnl_message_new_route(manager->rtnl, &m, RTM_DELROUTE, route->family, route->protocol);
|
||||
|
Loading…
Reference in New Issue
Block a user