]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/neighbor: drop IPv6 settings when the kernel does not support IPv6
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 10 Jul 2023 02:54:33 +0000 (11:54 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sun, 30 Jul 2023 12:57:13 +0000 (13:57 +0100)
src/network/networkd-neighbor.c

index 01d17dd3af7dc01629c2056638ac304b39f142cf..d7d53de37680e956279ca51241336f8a34cfc65c 100644 (file)
@@ -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. "