summaryrefslogtreecommitdiff
path: root/src/network/networkd-network.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-network.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-network.c')
-rw-r--r--src/network/networkd-network.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index e13e4a0f62..bbc5d279e9 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -341,6 +341,34 @@ int config_parse_netdev(const char *unit,
return 0;
}
+int config_parse_domains(const char *unit,
+ const char *filename,
+ unsigned line,
+ const char *section,
+ unsigned section_line,
+ const char *lvalue,
+ int ltype,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+ char ***domains = data;
+ char **domain;
+ int r;
+
+ r = config_parse_strv(unit, filename, line, section, section_line,
+ lvalue, ltype, rvalue, domains, userdata);
+ if (r < 0)
+ return r;
+
+ strv_uniq(*domains);
+
+ STRV_FOREACH(domain, *domains)
+ if (is_localhost(*domain) || !hostname_is_valid(*domain))
+ strv_remove(*domains, *domain);
+
+ return 0;
+}
+
int config_parse_tunnel(const char *unit,
const char *filename,
unsigned line,