#include "networkd.h"
#include "networkd-netdev.h"
+#include "networkd-link.h"
#include "network-internal.h"
#include "path-util.h"
#include "conf-files.h"
if (!network->filename)
return log_oom();
- network->ipv4ll_route = true;
-
network->dhcp = DHCP_SUPPORT_NONE;
network->dhcp_ntp = true;
network->dhcp_dns = true;
network->dhcp_hostname = true;
- network->dhcp_domainname = true;
network->dhcp_routes = true;
network->dhcp_sendhost = true;
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) {
+ Network *network = 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);
+ network->wildcard_domain = !!strv_find(*domains, "*");
+
+ STRV_FOREACH(domain, *domains)
+ if (is_localhost(*domain) || !hostname_is_valid(*domain) || streq(*domain, "*")) {
+ strv_remove(*domains, *domain);
+
+ /* We removed one entry, make sure we don't skip the next one */
+ domain--;
+ }
+
+ return 0;
+}
+
int config_parse_tunnel(const char *unit,
const char *filename,
unsigned line,