1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-10 01:17:44 +03:00

network: dhcp4: disable DHCPv4 client on interfaces with non-supported types

Replaces f42d41cc5f.
This commit is contained in:
Yu Watanabe 2022-07-14 05:05:32 +09:00
parent 8f4f630731
commit 7e2f684e1f

View 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;