1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-28 11:55:23 +03:00

networkd: remove "*" from domains list

Also, simplify things a bit and make sure we don't forget looking at one
of the entries.
This commit is contained in:
Lennart Poettering 2014-08-15 15:36:17 +02:00
parent 1405434b69
commit f15b6e5a8b

View File

@ -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;
}