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.
This commit is contained in:
Yu Watanabe 2021-10-15 05:57:30 +09:00
parent 10ab5ed5a8
commit d0619f2c2b
3 changed files with 5 additions and 2 deletions

View file

@ -2162,7 +2162,8 @@ Table=1234</programlisting></para>
<term><varname>RouteMetric=</varname></term>
<listitem>
<para>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.</para>
the range 0…4294967295. When set to 0, the kernel's default value is used. Defaults to 256.
</para>
</listitem>
</varlistentry>
</variablelist>

View file

@ -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;

View file

@ -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,