network: clear DNS and domains for RA when an empty string is assigned

This commit is contained in:
Yu Watanabe
2020-10-19 10:09:38 +09:00
parent 5e2767720a
commit a3c1a94947
+11
View 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;