]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: dhcp4: disable DHCPv4 client on interfaces with non-supported types
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 13 Jul 2022 20:05:32 +0000 (05:05 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 13 Jul 2022 21:52:07 +0000 (06:52 +0900)
Replaces f42d41cc5f9cd8cac538a1c30fda04d346b5bae2.

src/network/networkd-dhcp-common.c

index 45faf4f128914f8c02e4749634f0f52698152f0a..ce5262fcd6907c8337c98c1204004f4095bb024a 100644 (file)
@@ -52,6 +52,10 @@ bool link_dhcp_enabled(Link *link, int family) {
         assert(link);
         assert(IN_SET(family, AF_INET, AF_INET6));
 
+        /* Currently, sd-dhcp-client supports only ethernet and infiniband. */
+        if (family == AF_INET && !IN_SET(link->iftype, ARPHRD_ETHER, ARPHRD_INFINIBAND))
+                return false;
+
         if (family == AF_INET6 && !socket_ipv6_is_supported())
                 return false;