summaryrefslogtreecommitdiff
path: root/src/network/networkd-network.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-network.c')
-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;
}