network: dhcp4: also apply RouteMetric= setting in [DHCPv4] to prefix route

This commit is contained in:
Yu Watanabe
2021-04-21 13:55:02 +09:00
parent c4ff0629dd
commit 415deef9c3
+1
View File
@@ -893,6 +893,7 @@ static int dhcp4_update_address(Link *link, bool announce) {
if (prefixlen <= 30)
addr->broadcast.s_addr = address.s_addr | ~netmask.s_addr;
SET_FLAG(addr->flags, IFA_F_NOPREFIXROUTE, !link_prefixroute(link));
addr->route_metric = link->network->dhcp_route_metric;
/* allow reusing an existing address and simply update its lifetime
* in case it already exists */