1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-10 01:17:44 +03:00

network: route: make route_cancel_request() take Link*

As the Route object may be managed by Manager.
This commit is contained in:
Yu Watanabe 2021-12-05 05:01:30 +09:00
parent 1d44187ce6
commit 95eb38c8d0
6 changed files with 12 additions and 11 deletions

View File

@ -184,7 +184,7 @@ int dhcp6_pd_remove(Link *link, bool only_marked) {
if (k < 0)
r = k;
route_cancel_request(route);
route_cancel_request(route, link);
}
} else {
Address *address;

View File

@ -71,7 +71,7 @@ static int dhcp4_remove_address_and_routes(Link *link, bool only_marked) {
if (k < 0)
r = k;
route_cancel_request(route);
route_cancel_request(route, link);
}
SET_FOREACH(address, link->addresses) {

View File

@ -63,7 +63,7 @@ static int dhcp6_remove(Link *link, bool only_marked) {
if (k < 0)
r = k;
route_cancel_request(route);
route_cancel_request(route, link);
}
SET_FOREACH(address, link->addresses) {

View File

@ -90,7 +90,7 @@ static int ndisc_remove(Link *link, struct in6_addr *router) {
if (k < 0)
r = k;
route_cancel_request(route);
route_cancel_request(route, link);
}
SET_FOREACH(address, link->addresses) {

View File

@ -1260,24 +1260,25 @@ static int route_configure(
return 0;
}
void route_cancel_request(Route *route) {
void route_cancel_request(Route *route, Link *link) {
Request req;
assert(route);
link = route->link ?: link;
assert(link);
if (!route_is_requesting(route))
return;
if (!route->link)
return;
req = (Request) {
.link = route->link,
.link = link,
.type = REQUEST_TYPE_ROUTE,
.route = route,
};
request_drop(ordered_set_get(route->link->manager->request_queue, &req));
request_drop(ordered_set_get(link->manager->request_queue, &req));
route_cancel_requesting(route);
}

View File

@ -86,7 +86,7 @@ int link_drop_routes(Link *link);
int link_drop_foreign_routes(Link *link);
void link_foreignize_routes(Link *link);
void route_cancel_request(Route *route);
void route_cancel_request(Route *route, Link *link);
int link_request_route(
Link *link,
Route *route,