1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

network: introduce ManageTemporaryAddress= setting in [DHCPv6PrefixDelegation] section

The setting is enabled by default, as NDisc also enabled the flag by
default.

Closes #18208.
This commit is contained in:
Yu Watanabe 2021-01-13 06:34:32 +09:00
parent 8b76ee89d7
commit fec1b650ad
6 changed files with 14 additions and 2 deletions

View File

@ -1081,11 +1081,11 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para>
<listitem>
<para>Takes a boolean. If true the kernel manage temporary addresses created
from this one as template on behalf of Privacy Extensions
<ulink url="https://tools.ietf.org/html/rfc3041">RFC 3041</ulink>. For this to become
<ulink url="https://tools.ietf.org/html/rfc3041">RFC 3041</ulink>. For this to become
active, the use_tempaddr sysctl setting has to be set to a value greater than zero.
The given address needs to have a prefix length of 64. This flag allows using privacy
extensions in a manually configured network, just like if stateless auto-configuration
was active. Defaults to false. </para>
was active. Defaults to false.</para>
</listitem>
</varlistentry>
<varlistentry>
@ -2056,6 +2056,13 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para>
addresses. Defaults to unset.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>ManageTemporaryAddress=</varname></term>
<listitem>
<para>As in the [Address] section, but defaults to true.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

View File

@ -400,6 +400,7 @@ static int dhcp6_set_pd_address(
address->family = AF_INET6;
address->cinfo.ifa_prefered = lifetime_preferred;
address->cinfo.ifa_valid = lifetime_valid;
SET_FLAG(address->flags, IFA_F_MANAGETEMPADDR, link->network->dhcp6_pd_manage_temporary_address);
r = address_configure(address, link, dhcp6_pd_address_handler, true, &ret);
if (r < 0)

View File

@ -295,6 +295,7 @@ BridgeVLAN.EgressUntagged, config_parse_brvlan_untagged,
DHCPv6PrefixDelegation.SubnetId, config_parse_dhcp6_pd_subnet_id, 0, offsetof(Network, dhcp6_pd_subnet_id)
DHCPv6PrefixDelegation.Announce, config_parse_bool, 0, offsetof(Network, dhcp6_pd_announce)
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.Token, config_parse_dhcp6_pd_token, 0, offsetof(Network, dhcp6_pd_token)
IPv6SendRA.RouterLifetimeSec, config_parse_sec, 0, offsetof(Network, router_lifetime_usec)
IPv6SendRA.Managed, config_parse_bool, 0, offsetof(Network, router_managed)

View File

@ -361,6 +361,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
.dhcp6_pd = -1,
.dhcp6_pd_announce = true,
.dhcp6_pd_assign = true,
.dhcp6_pd_manage_temporary_address = true,
.dhcp6_pd_subnet_id = -1,
.dhcp_server_emit[SD_DHCP_LEASE_DNS].emit = true,

View File

@ -200,6 +200,7 @@ struct Network {
int dhcp6_pd;
bool dhcp6_pd_announce;
bool dhcp6_pd_assign;
bool dhcp6_pd_manage_temporary_address;
int64_t dhcp6_pd_subnet_id;
union in_addr_union dhcp6_pd_token;

View File

@ -143,6 +143,7 @@ RouteMetric=
SubnetId=
Announce=
Assign=
ManageTemporaryAddress=
Token=
[Route]
Destination=