summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-network-gperf.gperf2
-rw-r--r--src/network/networkd-route.c36
-rw-r--r--src/network/networkd.h3
3 files changed, 40 insertions, 1 deletions
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
index c821eadb70..50cb0f8be9 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -43,7 +43,7 @@ Address.Peer, config_parse_address, 0,
Address.Broadcast, config_parse_broadcast, 0, 0
Address.Label, config_parse_label, 0, 0
Route.Gateway, config_parse_gateway, 0, 0
-Route.Destination, config_parse_destination, 0, 0
+Route.Metric, config_parse_route_priority, 0, 0
DHCP.UseDNS, config_parse_bool, 0, offsetof(Network, dhcp_dns)
DHCP.UseMTU, config_parse_bool, 0, offsetof(Network, dhcp_mtu)
DHCP.UseHostname, config_parse_bool, 0, offsetof(Network, dhcp_hostname)
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
index acfe3f023f..9e6295f8c8 100644
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -360,3 +360,39 @@ int config_parse_destination(const char *unit,
return 0;
}
+
+int config_parse_route_priority(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;
+ _cleanup_route_free_ Route *n = NULL;
+ _cleanup_free_ char *route = NULL;
+ int r;
+
+ assert(filename);
+ assert(section);
+ assert(lvalue);
+ assert(rvalue);
+ assert(data);
+
+ r = route_new_static(network, section_line, &n);
+ if (r < 0)
+ return r;
+
+ r = config_parse_unsigned(unit, filename, line, section,
+ section_line, lvalue, ltype,
+ rvalue, &n->metrics, userdata);
+ if (r < 0)
+ return r;
+
+ n = NULL;
+
+ return 0;
+}
diff --git a/src/network/networkd.h b/src/network/networkd.h
index 9132e70217..aca3b8dd24 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -467,6 +467,9 @@ int config_parse_destination(const char *unit, const char *filename, unsigned li
const char *section, unsigned section_line, const char *lvalue,
int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_route_priority(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);
/* Address */
int address_new_static(Network *network, unsigned section, Address **ret);
int address_new_dynamic(Address **ret);