]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: allow to set null address for [DHCPServer] ServerAddress=
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 7 Sep 2023 21:35:26 +0000 (06:35 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 8 Sep 2023 11:03:40 +0000 (20:03 +0900)
And refuse a link-local address.

With the previous commit, now ServerAddress= can take a null address,
but the config parser refused that. Let's allow that now.

src/network/networkd-dhcp-server.c

index 63c520fa89d1fcccb0998c684a46502a43489f68..cf7b8e1b629c8424a352e79d1dcd06b6db08bb38 100644 (file)
@@ -718,9 +718,9 @@ int config_parse_dhcp_server_address(
                            "Failed to parse %s=, ignoring assignment: %s", lvalue, rvalue);
                 return 0;
         }
-        if (in4_addr_is_null(&a.in) || in4_addr_is_localhost(&a.in)) {
+        if (in4_addr_is_localhost(&a.in) || in4_addr_is_link_local(&a.in)) {
                 log_syntax(unit, LOG_WARNING, filename, line, 0,
-                           "DHCP server address cannot be the ANY address or a localhost address, "
+                           "DHCP server address cannot be a localhost or link-local address, "
                            "ignoring assignment: %s", rvalue);
                 return 0;
         }