From: Yu Watanabe Date: Thu, 14 Oct 2021 20:57:30 +0000 (+0900) Subject: network: dhcp6pd: set default metric 256 for delegated prefix X-Git-Tag: v250-rc1~465^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d0619f2c2b3865e930da9832a246c97d35f63b85;p=thirdparty%2Fsystemd.git network: dhcp6pd: set default metric 256 for delegated prefix When Assign= in [DHCPv6PrefixDelegation] is enabled, then the kernel will create the prefix route for the assigned address with metric 256. When Assign= is disabled, then the kernel will create the route with metric 1024. For the default value, we should choose a smaller value (higher priority) than 1024, as the unreachable routes for delegated prefix will be configured with 1024. --- diff --git a/man/systemd.network.xml b/man/systemd.network.xml index bcc86417c69..01297c397f3 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -2162,7 +2162,8 @@ Table=1234 RouteMetric= The metric of the route to the delegated prefix subnet. Takes an unsigned integer in - the range 0…4294967295. When unset or set to 0, the kernel's default value is used. + the range 0…4294967295. When set to 0, the kernel's default value is used. Defaults to 256. + diff --git a/src/network/networkd-dhcp-common.h b/src/network/networkd-dhcp-common.h index 4a98038391a..2573247db20 100644 --- a/src/network/networkd-dhcp-common.h +++ b/src/network/networkd-dhcp-common.h @@ -10,6 +10,7 @@ #include "time-util.h" #define DHCP_ROUTE_METRIC 1024 +#define DHCP6PD_ROUTE_METRIC 256 typedef struct Link Link; typedef struct Manager Manager; diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index a367041e991..798f4099297 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -409,7 +409,8 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi .dhcp6_pd_announce = true, .dhcp6_pd_assign = true, .dhcp6_pd_manage_temporary_address = true, - .dhcp6_pd_subnet_id = -1, + .dhcp6_pd_subnet_id = UINT64_MAX, + .dhcp6_pd_route_metric = DHCP6PD_ROUTE_METRIC, .dhcp_server_bind_to_interface = true, .dhcp_server_emit[SD_DHCP_LEASE_DNS].emit = true,