summaryrefslogtreecommitdiff
path: root/src/network/networkd-network.c
diff options
context:
space:
mode:
authorJason Kölker <jason@koelker.net>2016-09-19 02:26:12 +0000
committerJason Kölker <jason@koelker.net>2016-09-19 03:27:42 +0000
commitf594276b8659a04a8cb18ea3fef3ddb1ed10524a (patch)
treec0342b9fc7c412ea8e809dc64faac9a81c2163cb /src/network/networkd-network.c
parentdd8352659c9428b196706d04399eec106a8917ed (diff)
networkd: Allow specifying RouteTable for DHCP
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r--src/network/networkd-network.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 313abca762..c7dc785b24 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -111,6 +111,7 @@ static int network_load_one(Manager *manager, const char *filename) {
network->dhcp_send_hostname = true;
network->dhcp_route_metric = DHCP_ROUTE_METRIC;
network->dhcp_client_identifier = DHCP_CLIENT_ID_DUID;
+ network->dhcp_route_table = RT_TABLE_MAIN;
network->dhcp_server_emit_dns = true;
network->dhcp_server_emit_ntp = true;
@@ -1033,6 +1034,36 @@ int config_parse_dnssec_negative_trust_anchors(
return 0;
}
+int config_parse_dhcp_route_table(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) {
+ uint32_t rt;
+ int r;
+
+ assert(filename);
+ assert(lvalue);
+ assert(rvalue);
+ assert(data);
+
+ r = safe_atou32(rvalue, &rt);
+ if (r < 0) {
+ log_syntax(unit, LOG_ERR, filename, line, r,
+ "Unable to read RouteTable, ignoring assignment: %s", rvalue);
+ return 0;
+ }
+
+ *((uint32_t *)data) = rt;
+
+ return 0;
+}
+
DEFINE_CONFIG_PARSE_ENUM(config_parse_dhcp_use_domains, dhcp_use_domains, DHCPUseDomains, "Failed to parse DHCP use domains setting");
static const char* const dhcp_use_domains_table[_DHCP_USE_DOMAINS_MAX] = {