summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-12-12 02:52:09 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-12-17 00:14:30 +0900
commit8a20a8438f57f9301e0c4ddccf2d13cd8fd9a8b2 (patch)
tree3660ca55c7107ddf44e9f82051c668a4ff8d3276
parentf974f17ae7efe249d84de79d71fc4b7a45f19280 (diff)
downloadsystemd-8a20a8438f57f9301e0c4ddccf2d13cd8fd9a8b2.tar.gz
network: route: link_drop_foreign_routes() must be called only for managed interfaces
-rw-r--r--src/network/networkd-route.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
index bfd849abb9..156476066a 100644
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -893,6 +893,7 @@ int link_drop_foreign_routes(Link *link) {
assert(link);
assert(link->manager);
+ assert(link->network);
SET_FOREACH(route, link->routes) {
/* do not touch routes managed by the kernel */
@@ -907,11 +908,11 @@ int link_drop_foreign_routes(Link *link) {
if (!route_exists(route))
continue;
- if (route->protocol == RTPROT_STATIC && link->network &&
+ if (route->protocol == RTPROT_STATIC &&
FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_STATIC))
continue;
- if (route->protocol == RTPROT_DHCP && link->network &&
+ if (route->protocol == RTPROT_DHCP &&
FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP))
continue;