mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
network: dhcp6-pd: add RouteMetric= setting in [DHCPv6PrefixDelegation]
This commit is contained in:
parent
8ebafba9f9
commit
9fe0b7b493
@ -2160,6 +2160,14 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para>
|
|||||||
<para>As in the [Address] section, but defaults to true.</para>
|
<para>As in the [Address] section, but defaults to true.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<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>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -284,6 +284,7 @@ static int dhcp6_set_pd_route(Link *link, const union in_addr_union *prefix, con
|
|||||||
route->dst = *prefix;
|
route->dst = *prefix;
|
||||||
route->dst_prefixlen = 64;
|
route->dst_prefixlen = 64;
|
||||||
route->protocol = RTPROT_DHCP;
|
route->protocol = RTPROT_DHCP;
|
||||||
|
route->priority = link->network->dhcp6_pd_route_metric;
|
||||||
|
|
||||||
r = route_configure(route, link, dhcp6_pd_route_handler, &ret);
|
r = route_configure(route, link, dhcp6_pd_route_handler, &ret);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
@ -399,6 +400,7 @@ static int dhcp6_set_pd_address(
|
|||||||
address->cinfo.ifa_prefered = lifetime_preferred;
|
address->cinfo.ifa_prefered = lifetime_preferred;
|
||||||
address->cinfo.ifa_valid = lifetime_valid;
|
address->cinfo.ifa_valid = lifetime_valid;
|
||||||
SET_FLAG(address->flags, IFA_F_MANAGETEMPADDR, link->network->dhcp6_pd_manage_temporary_address);
|
SET_FLAG(address->flags, IFA_F_MANAGETEMPADDR, link->network->dhcp6_pd_manage_temporary_address);
|
||||||
|
address->route_metric = link->network->dhcp6_pd_route_metric;
|
||||||
|
|
||||||
r = address_configure(address, link, dhcp6_pd_address_handler, &ret);
|
r = address_configure(address, link, dhcp6_pd_address_handler, &ret);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
|
@ -309,6 +309,7 @@ DHCPv6PrefixDelegation.Announce, config_parse_bool,
|
|||||||
DHCPv6PrefixDelegation.Assign, config_parse_bool, 0, offsetof(Network, dhcp6_pd_assign)
|
DHCPv6PrefixDelegation.Assign, config_parse_bool, 0, offsetof(Network, dhcp6_pd_assign)
|
||||||
DHCPv6PrefixDelegation.ManageTemporaryAddress, config_parse_bool, 0, offsetof(Network, dhcp6_pd_manage_temporary_address)
|
DHCPv6PrefixDelegation.ManageTemporaryAddress, config_parse_bool, 0, offsetof(Network, dhcp6_pd_manage_temporary_address)
|
||||||
DHCPv6PrefixDelegation.Token, config_parse_dhcp6_pd_token, 0, offsetof(Network, dhcp6_pd_token)
|
DHCPv6PrefixDelegation.Token, config_parse_dhcp6_pd_token, 0, offsetof(Network, dhcp6_pd_token)
|
||||||
|
DHCPv6PrefixDelegation.RouteMetric, config_parse_uint32, 0, offsetof(Network, dhcp6_pd_route_metric)
|
||||||
IPv6SendRA.RouterLifetimeSec, config_parse_sec, 0, offsetof(Network, router_lifetime_usec)
|
IPv6SendRA.RouterLifetimeSec, config_parse_sec, 0, offsetof(Network, router_lifetime_usec)
|
||||||
IPv6SendRA.Managed, config_parse_bool, 0, offsetof(Network, router_managed)
|
IPv6SendRA.Managed, config_parse_bool, 0, offsetof(Network, router_managed)
|
||||||
IPv6SendRA.OtherInformation, config_parse_bool, 0, offsetof(Network, router_other_information)
|
IPv6SendRA.OtherInformation, config_parse_bool, 0, offsetof(Network, router_other_information)
|
||||||
|
@ -219,6 +219,7 @@ struct Network {
|
|||||||
bool dhcp6_pd_assign;
|
bool dhcp6_pd_assign;
|
||||||
bool dhcp6_pd_manage_temporary_address;
|
bool dhcp6_pd_manage_temporary_address;
|
||||||
int64_t dhcp6_pd_subnet_id;
|
int64_t dhcp6_pd_subnet_id;
|
||||||
|
uint32_t dhcp6_pd_route_metric;
|
||||||
union in_addr_union dhcp6_pd_token;
|
union in_addr_union dhcp6_pd_token;
|
||||||
|
|
||||||
/* Bridge Support */
|
/* Bridge Support */
|
||||||
|
@ -147,6 +147,7 @@ Announce=
|
|||||||
Assign=
|
Assign=
|
||||||
ManageTemporaryAddress=
|
ManageTemporaryAddress=
|
||||||
Token=
|
Token=
|
||||||
|
RouteMetric=
|
||||||
[Route]
|
[Route]
|
||||||
Destination=
|
Destination=
|
||||||
Protocol=
|
Protocol=
|
||||||
|
Loading…
Reference in New Issue
Block a user