summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-dhcp-server.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-02-01 23:20:25 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-02-02 02:02:57 +0100
commitfaa1b3c6c415abb201d03ab1c46f9e89100ab9b2 (patch)
tree5f862f43c71ae0898df3b020b4d61c381fb8c564 /src/network/networkd-dhcp-server.c
parentsd-dhcp-lease: store static routes and classless static routes in different a... (diff)
downloadsystemd-faa1b3c6c415abb201d03ab1c46f9e89100ab9b2.tar.xz
systemd-faa1b3c6c415abb201d03ab1c46f9e89100ab9b2.zip
network: dhcp-server: make empty string to DNS= or friends clear previously specified servers
Diffstat (limited to 'src/network/networkd-dhcp-server.c')
-rw-r--r--src/network/networkd-dhcp-server.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c
index 32a129a6f6..48e919ce93 100644
--- a/src/network/networkd-dhcp-server.c
+++ b/src/network/networkd-dhcp-server.c
@@ -634,6 +634,12 @@ int config_parse_dhcp_server_emit(
assert(emit);
assert(rvalue);
+ if (isempty(rvalue)) {
+ emit->addresses = mfree(emit->addresses);
+ emit->n_addresses = 0;
+ return 0;
+ }
+
for (const char *p = rvalue;;) {
_cleanup_free_ char *w = NULL;
union in_addr_union a;