summaryrefslogtreecommitdiff
path: root/src/network/networkd-network.c
diff options
context:
space:
mode:
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,