diff options
author | Tom Gundersen <teg@jklm.no> | 2014-08-15 14:49:31 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-08-15 15:15:24 +0200 |
commit | 67272d157a35e5cda4e5c904eafdcc23d20541d1 (patch) | |
tree | 99befd9c7b29c91d355ed02b4236e58aefab7e5a /src/network | |
parent | 6192b846ca0d15602e94ddb5da4420b7c60d64a5 (diff) |
sd-network: add support for wildcard domains
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkctl.c | 7 | ||||
-rw-r--r-- | src/network/networkd-link.c | 3 | ||||
-rw-r--r-- | src/network/networkd-network.c | 6 | ||||
-rw-r--r-- | src/network/networkd.h | 1 |
4 files changed, 17 insertions, 0 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 33fe8bfc61..bf95aa2c90 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -366,6 +366,13 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) { sd_network_link_get_dns(ifindex, &dns); sd_network_link_get_ntp(ifindex, &ntp); sd_network_link_get_domains(ifindex, &domains); + r = sd_network_link_get_wildcard_domain(ifindex); + if (r > 0) { + char *wildcard; + + wildcard = strdup("*"); + strv_push(&domains, wildcard); + } sprintf(devid, "n%i", ifindex); d = udev_device_new_from_device_id(udev, devid); diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index d25343ba2b..76e642758d 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1784,6 +1784,9 @@ int link_save(Link *link) { fputs("\n", f); + fprintf(f, "WILDCARD_DOMAIN=%s\n", + yes_no(link->network->wildcard_domain)); + fprintf(f, "LLMNR=%s\n", llmnr_support_to_string(link->network->llmnr)); } diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index bbc5d279e9..f3b2c68430 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -351,6 +351,7 @@ int config_parse_domains(const char *unit, const char *rvalue, void *data, void *userdata) { + Network *network = userdata; char ***domains = data; char **domain; int r; @@ -362,6 +363,11 @@ int config_parse_domains(const char *unit, strv_uniq(*domains); + if (strv_isempty(*domains)) + network->wildcard_domain = false; + else if (strv_find(*domains, "*")) + network->wildcard_domain = true; + STRV_FOREACH(domain, *domains) if (is_localhost(*domain) || !hostname_is_valid(*domain)) strv_remove(*domains, *domain); diff --git a/src/network/networkd.h b/src/network/networkd.h index a9867d9e7f..c8d89d212b 100644 --- a/src/network/networkd.h +++ b/src/network/networkd.h @@ -111,6 +111,7 @@ struct Network { Hashmap *addresses_by_section; Hashmap *routes_by_section; + bool wildcard_domain; char **domains, **dns, **ntp; LLMNRSupport llmnr; |