]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: clear DNS and domains for RA when an empty string is assigned
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 15 Oct 2020 06:56:25 +0000 (15:56 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 19 Oct 2020 01:09:38 +0000 (10:09 +0900)
src/network/networkd-radv.c

index 8949d91e2fcd9575fd74112237a53381e7132d65..fca6fa2c97e5a7c4d940993fc9e786a6db33fdf8 100644 (file)
@@ -773,6 +773,12 @@ int config_parse_radv_dns(
         assert(lvalue);
         assert(rvalue);
 
+        if (isempty(rvalue)) {
+                n->n_router_dns = 0;
+                n->router_dns = mfree(n->router_dns);
+                return 0;
+        }
+
         for (const char *p = rvalue;;) {
                 _cleanup_free_ char *w = NULL;
                 union in_addr_union a;
@@ -834,6 +840,11 @@ int config_parse_radv_search_domains(
         assert(lvalue);
         assert(rvalue);
 
+        if (isempty(rvalue)) {
+                n->router_search_domains = ordered_set_free(n->router_search_domains);
+                return 0;
+        }
+
         for (const char *p = rvalue;;) {
                 _cleanup_free_ char *w = NULL, *idna = NULL;