From: Yu Watanabe Date: Mon, 10 Jul 2023 03:32:40 +0000 (+0900) Subject: network/address: drop IPv6 settings when the kernel does not support IPv6 X-Git-Tag: v255-rc1~883^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9e2afc033d28ea2661c0dda26b91c39b78caf97;p=thirdparty%2Fsystemd.git network/address: drop IPv6 settings when the kernel does not support IPv6 --- diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index c33ffa95766..fbc066aa5ce 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -2131,11 +2131,17 @@ static int address_section_verify(Address *address) { assert(address->section); return log_warning_errno(SYNTHETIC_ERRNO(EINVAL), - "%s: Address section without Address= field configured. " + "%s: Address section without Address= field was configured. " "Ignoring [Address] section from line %u.", address->section->filename, address->section->line); } + if (address->family == AF_INET6 && !socket_ipv6_is_supported()) + return log_warning_errno(SYNTHETIC_ERRNO(EINVAL), + "%s: an IPv6 address was configured, but the kernel does not support IPv6. " + "Ignoring [Address] section from line %u.", + address->section->filename, address->section->line); + assert(IN_SET(address->family, AF_INET, AF_INET6)); address_section_adjust_broadcast(address);