network/address: drop IPv6 settings when the kernel does not support IPv6

This commit is contained in:
Yu Watanabe
2023-07-30 22:53:15 +09:00
parent ae85704760
commit d9e2afc033
+7 -1
View File
@@ -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);