]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: check the existence of the route
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 11 Dec 2021 17:48:03 +0000 (02:48 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 16 Dec 2021 15:13:42 +0000 (00:13 +0900)
src/network/networkd-address.c

index 603882bd4541bef85f8e8514ff654f7dd46f59b2..7df743efb55768e40c127542388fc3a013698e97 100644 (file)
@@ -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;