summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-08-15 14:21:08 +0200
committerTom Gundersen <teg@jklm.no>2014-08-15 15:15:24 +0200
commit6192b846ca0d15602e94ddb5da4420b7c60d64a5 (patch)
treeaff8d3115a6fc783c95167a221a0069a82f4c9b2 /src/network/networkd-link.c
parent2f3a215f61d758cd59b3be5b65976a12401ac4ff (diff)
networkd: add support for Domains= to .network files
This allows the search/routing domanis to be specified per link/network and be passed on to resolved.
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 9eb2e89091..d25343ba2b 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1722,6 +1722,7 @@ int link_save(Link *link) {
if (link->network) {
char **address;
+ char **domain;
fputs("DNS=", f);
@@ -1763,15 +1764,26 @@ int link_save(Link *link) {
fputs("\n", f);
+ fprintf(f, "DOMAINS=");
+
if (link->network->dhcp_domains &&
link->dhcp_lease) {
const char *domainname;
r = sd_dhcp_lease_get_domainname(link->dhcp_lease, &domainname);
- if (r >= 0)
- fprintf(f, "DOMAINS=%s\n", domainname);
+ if (r >= 0) {
+ fputs(domainname, f);
+ if (link->network->domains)
+ fputs(" ", f);
+ }
}
+ STRV_FOREACH(domain, link->network->domains)
+ fprintf(f, "%s%s", *domain,
+ (domain + 1 ? " " : ""));
+
+ fputs("\n", f);
+
fprintf(f, "LLMNR=%s\n",
llmnr_support_to_string(link->network->llmnr));
}