summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-12-12 02:48:03 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-12-17 00:13:42 +0900
commitf974f17ae7efe249d84de79d71fc4b7a45f19280 (patch)
treef8874de2e9424cda394d3dfc3bcd63d5ee1eda50
parenta71c5c44f73553e1af6c10645fa3b5ca0a12f87a (diff)
downloadsystemd-f974f17ae7efe249d84de79d71fc4b7a45f19280.tar.gz
networkd: check the existence of the route
-rw-r--r--src/network/networkd-address.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index 603882bd45..7df743efb5 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -728,6 +728,10 @@ bool link_address_is_dynamic(const Link *link, const Address *address) {
if (route->source != NETWORK_CONFIG_SOURCE_FOREIGN)
continue;
+ /* The route is not assigned yet, or already removed. Ignoring. */
+ if (!route_exists(route))
+ continue;
+
if (route->protocol != RTPROT_DHCP)
continue;