diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-09-07 23:35:26 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-09-08 13:03:40 +0200 |
commit | a0dfce0a3f3cec2db0d10eb13987a363ef4f620f (patch) | |
tree | 1967724b7736e6bf2f22bee1638543dcbeebbb8b | |
parent | network: find DHCP server address only on loading .network file (diff) | |
download | systemd-a0dfce0a3f3cec2db0d10eb13987a363ef4f620f.tar.xz systemd-a0dfce0a3f3cec2db0d10eb13987a363ef4f620f.zip |
network: allow to set null address for [DHCPServer] ServerAddress=
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.
-rw-r--r-- | src/network/networkd-dhcp-server.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c index 63c520fa89..cf7b8e1b62 100644 --- a/src/network/networkd-dhcp-server.c +++ b/src/network/networkd-dhcp-server.c @@ -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; } |