]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: Be opportunistic when declaring link configured 1373/head
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 24 Sep 2015 12:04:17 +0000 (15:04 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 24 Sep 2015 12:20:41 +0000 (15:20 +0300)
The DHCP variable in the [Network] section of the network configuration
file moves the link to the configured state according to the following:

DHCP=yes   Link is configured when either DHCPv4 or DHCPv6 succeed
DHCP=ipv4  Link is configured only when DHCPv4 succeeds
DHCP=ipv6  Link is configured only when DHCPv6 succeeds
DHCP=no    Neither DHCPv4 or DHCPv6 is attempted

Reported by Martin Pitt.

Fixes https://github.com/systemd/systemd/issues/1368

src/network/networkd-link.c

index 5dd14b1104259869d4de3a2df9415d22e0a8077b..db3975f466d97fb0ccf84184d34135d59a6ed340 100644 (file)
@@ -501,10 +501,12 @@ void link_client_handler(Link *link) {
                     !link->ipv4ll_route)
                         return;
 
-        if (link_dhcp4_enabled(link) && !link->dhcp4_configured)
-                        return;
-
-        if (link_dhcp6_enabled(link) && !link->dhcp6_configured)
+        if ((link_dhcp4_enabled(link) && !link_dhcp6_enabled(link) &&
+             !link->dhcp4_configured) ||
+            (link_dhcp6_enabled(link) && !link_dhcp4_enabled(link) &&
+             !link->dhcp6_configured) ||
+            (link_dhcp4_enabled(link) && link_dhcp6_enabled(link) &&
+             !link->dhcp4_configured && !link->dhcp6_configured))
                 return;
 
         if (link->state != LINK_STATE_CONFIGURED)