summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-15 15:36:17 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-15 15:36:17 +0200
commitf15b6e5a8b6e550c6df7f6ccc216d5c4cbe6a604 (patch)
treec0289b74c0c7062423b435cc4b559687e416be50 /src
parent1405434b6986d3c3d6ccaaa2e472bad843cbbfa1 (diff)
networkd: remove "*" from domains list
Also, simplify things a bit and make sure we don't forget looking at one of the entries.
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-network.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index f3b2c68430..6f0d1a1689 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -362,16 +362,16 @@ int config_parse_domains(const char *unit,
return r;
strv_uniq(*domains);
-
- if (strv_isempty(*domains))
- network->wildcard_domain = false;
- else if (strv_find(*domains, "*"))
- network->wildcard_domain = true;
+ network->wildcard_domain = !!strv_find(*domains, "*");
STRV_FOREACH(domain, *domains)
- if (is_localhost(*domain) || !hostname_is_valid(*domain))
+ if (is_localhost(*domain) || !hostname_is_valid(*domain) || streq(*domain, "*")) {
strv_remove(*domains, *domain);
+ /* We removed one entry, make sure we don't skip the next one */
+ domain--;
+ }
+
return 0;
}