diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-06-10 20:43:06 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-06-10 20:43:06 +0200 |
commit | ad091530b30bfbbc94159c17f3ea434a835ad3c9 (patch) | |
tree | a22b274eae94d3edfbe262c91a047a723ac29947 /src/network/networkd-network.c | |
parent | 4061eed4d91226f1f75e79350c5e1bdd4529d578 (diff) | |
parent | 37de250906222211d2bf1755c41191a06d2126dd (diff) |
Merge pull request #151 from mischief/dns-shared-3
move dns code from resolve to shared v3
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r-- | src/network/networkd-network.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 5947084106..6f32e5f4a4 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -30,6 +30,7 @@ #include "networkd-netdev.h" #include "networkd-link.h" #include "network-internal.h" +#include "dns-domain.h" static int network_load_one(Manager *manager, const char *filename) { _cleanup_network_free_ Network *network = NULL; @@ -466,11 +467,16 @@ int config_parse_domains(const char *unit, STRV_FOREACH(domain, *domains) { if (is_localhost(*domain)) log_syntax(unit, LOG_ERR, filename, line, EINVAL, "'localhost' domain names may not be configured, ignoring assignment: %s", *domain); - else if (!hostname_is_valid(*domain)) { - if (!streq(*domain, "*")) - log_syntax(unit, LOG_ERR, filename, line, EINVAL, "domain name is not valid, ignoring assignment: %s", *domain); - } else - continue; + else { + r = dns_name_is_valid(*domain); + if (r <= 0 && !streq(*domain, "*")) { + if (r < 0) + log_error_errno(r, "Failed to validate domain name: %s: %m", *domain); + if (r == 0) + log_warning("Domain name is not valid, ignoring assignment: %s", *domain); + } else + continue; + } strv_remove(*domains, *domain); |