mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 18:23:32 +08:00
network/route: fix unexpected removal of routes for wireguard
Fixes a bug introduced by 8d01e44c1f
.
If a .netdev file for a wireguard interface requests to configure
routes for the interface, the routes were removed during configuring
another interface.
Fixes #32859.
This commit is contained in:
parent
1cd53a1f91
commit
d7769b4d8e
@ -1430,16 +1430,16 @@ static int link_mark_routes(Link *link, bool foreign) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Also unmark routes requested in .netdev file. */
|
||||
if (foreign && link->netdev && link->netdev->kind == NETDEV_KIND_WIREGUARD) {
|
||||
Wireguard *w = WIREGUARD(link->netdev);
|
||||
/* Also unmark routes requested in .netdev file. */
|
||||
if (other->netdev && other->netdev->kind == NETDEV_KIND_WIREGUARD) {
|
||||
Wireguard *w = WIREGUARD(other->netdev);
|
||||
|
||||
SET_FOREACH(route, w->routes) {
|
||||
r = link_unmark_route(link, route, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
SET_FOREACH(route, w->routes) {
|
||||
r = link_unmark_route(other, route, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user