]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: dhcp4: also apply RouteMetric= setting in [DHCPv4] to prefix route
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 17 Apr 2021 17:04:20 +0000 (02:04 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 21 Apr 2021 04:55:02 +0000 (13:55 +0900)
src/network/networkd-dhcp4.c

index 215705712163a89cb362761c1c3bd3ab61b7a3af..85b909e576b31ce8ed7947794ceba9003d336c98 100644 (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 */