]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: start dynamic addressing clients like DHCP after setting netdevs
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 Oct 2020 07:47:10 +0000 (16:47 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 14 Oct 2020 08:52:02 +0000 (10:52 +0200)
The function link_acquire_conf() may make the link state 'configuring'
when DHCP6 PD is enabled. Previously link_acquire_conf() was called
before link_enter_join_netdev(), and thus the assertion in the function
might be triggered.

Fixes #17329.

src/network/networkd-link.c

index b32a436be50a6d7c2d573c037f3fc37e4e9cc91c..24b3aab48b092e3b07346819e3f5eba050a8aa23 100644 (file)
@@ -1758,6 +1758,11 @@ static int link_joined(Link *link) {
                 return 0;
 
         link_set_state(link, LINK_STATE_CONFIGURING);
+
+        r = link_acquire_conf(link);
+        if (r < 0)
+                return r;
+
         return link_set_static_configs(link);
 }
 
@@ -2038,12 +2043,6 @@ static int link_configure_continue(Link *link) {
         if (r < 0)
                 log_link_warning_errno(link, r, "Cannot set IPv6 MTU for interface, ignoring: %m");
 
-        if (link_has_carrier(link) || link->network->configure_without_carrier) {
-                r = link_acquire_conf(link);
-                if (r < 0)
-                        return r;
-        }
-
         return link_enter_join_netdev(link);
 }