]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: dhcp6: explicitly specify metric for unreachable route
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 14 Oct 2021 21:00:22 +0000 (06:00 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 19 Oct 2021 17:36:20 +0000 (02:36 +0900)
For static IPv6 routes without metric is specified, then we use 1024.
But such an adjustment is not performed to dynamic routes. So, let's
specify the metric explicitly.
Otherwise, configured routes will be handled as foreign.

src/network/networkd-dhcp6.c

index 0795ebdd46726c5efa2232387654a1a6e1f3e3b7..2bbad4edbbc31cdf3ea6f1584d68c9732951fa00 100644 (file)
@@ -777,6 +777,7 @@ static int dhcp6_request_unreachable_route(Link *link, const struct in6_addr *ad
         route->table = link_get_dhcp6_route_table(link);
         route->type = RTN_UNREACHABLE;
         route->protocol = RTPROT_DHCP;
+        route->priority = DHCP_ROUTE_METRIC;
         route->lifetime = usec_add(timestamp_usec, lifetime_sec * USEC_PER_SEC);
 
         if (route_get(link->manager, NULL, route, &existing) < 0)