From 84b5b79a8f7b423c5b7cad4170eb68d57fe5e26c Mon Sep 17 00:00:00 2001 From: Angus Gibson Date: Mon, 8 Sep 2014 20:26:47 +1000 Subject: networkd: allow specification of DHCP route metric This lets the routing metric for links to be specified per-network, still defaulting to DHCP_ROUTE_METRIC (1024) if unspecified. Hopefully this helps with multiple interfaces configured via DHCP. --- src/network/networkd-dhcp4.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/network/networkd-dhcp4.c') diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index b87fa73082..e0b3acad1b 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -103,7 +103,7 @@ static int link_set_dhcp_routes(Link *link) { route_gw->dst_prefixlen = 32; route_gw->prefsrc_addr.in = address; route_gw->scope = RT_SCOPE_LINK; - route_gw->metrics = DHCP_ROUTE_METRIC; + route_gw->metrics = link->network->dhcp_route_metric; r = route_configure(route_gw, link, &dhcp4_route_handler); if (r < 0) { @@ -118,7 +118,7 @@ static int link_set_dhcp_routes(Link *link) { route->family = AF_INET; route->in_addr.in = gateway; route->prefsrc_addr.in = address; - route->metrics = DHCP_ROUTE_METRIC; + route->metrics = link->network->dhcp_route_metric; r = route_configure(route, link, &dhcp4_route_handler); if (r < 0) { @@ -157,7 +157,7 @@ static int link_set_dhcp_routes(Link *link) { route->in_addr.in = static_routes[i].gw_addr; route->dst_addr.in = static_routes[i].dst_addr; route->dst_prefixlen = static_routes[i].dst_prefixlen; - route->metrics = DHCP_ROUTE_METRIC; + route->metrics = link->network->dhcp_route_metric; r = route_configure(route, link, &dhcp4_route_handler); if (r < 0) { -- cgit v1.2.3-54-g00ecf