From: Yu Watanabe Date: Mon, 10 Jul 2023 02:54:33 +0000 (+0900) Subject: network/neighbor: drop IPv6 settings when the kernel does not support IPv6 X-Git-Tag: v255-rc1~891 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d4d7910d935fb7db0ea2ce8cf3ad662fedb1bca;p=thirdparty%2Fsystemd.git network/neighbor: drop IPv6 settings when the kernel does not support IPv6 --- diff --git a/src/network/networkd-neighbor.c b/src/network/networkd-neighbor.c index 01d17dd3af7..d7d53de3768 100644 --- a/src/network/networkd-neighbor.c +++ b/src/network/networkd-neighbor.c @@ -560,6 +560,13 @@ static int neighbor_section_verify(Neighbor *neighbor) { "Ignoring [Neighbor] section from line %u.", neighbor->section->filename, neighbor->section->line); + if (neighbor->family == AF_INET6 && !socket_ipv6_is_supported()) + return log_warning_errno(SYNTHETIC_ERRNO(EINVAL), + "%s: Neighbor section with an IPv6 destination address configured, " + "but the kernel does not support IPv6. " + "Ignoring [Neighbor] section from line %u.", + neighbor->section->filename, neighbor->section->line); + if (neighbor->ll_addr.length == 0) return log_warning_errno(SYNTHETIC_ERRNO(EINVAL), "%s: Neighbor section without LinkLayerAddress= configured. "