From: Yu Watanabe Date: Wed, 13 Jul 2022 20:05:32 +0000 (+0900) Subject: network: dhcp4: disable DHCPv4 client on interfaces with non-supported types X-Git-Tag: v252-rc1~661^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7e2f684e1fa391bd511b52bbbe4a3971cdc5ec33;p=thirdparty%2Fsystemd.git network: dhcp4: disable DHCPv4 client on interfaces with non-supported types Replaces f42d41cc5f9cd8cac538a1c30fda04d346b5bae2. --- diff --git a/src/network/networkd-dhcp-common.c b/src/network/networkd-dhcp-common.c index 45faf4f1289..ce5262fcd69 100644 --- a/src/network/networkd-dhcp-common.c +++ b/src/network/networkd-dhcp-common.c @@ -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;