Closes #28186.
specified earlier are cleared. Defaults to unset.</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term><varname>IPv6PrivacyExtensions=</varname></term>
+ <listitem>
+ <para>Specifies the default value for per-network <varname>IPv6PrivacyExtensions=</varname>.
+ Takes a boolean or the special values <literal>prefer-public</literal> and
+ <literal>kernel</literal>. See for details in
+ <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+ Defaults to <literal>no</literal>.</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect1>
enables the privacy extensions and prefers temporary addresses over public addresses. When
<literal>prefer-public</literal>, enables the privacy extensions, but prefers public
addresses over temporary addresses. When false, the privacy extensions remain disabled. When
- <literal>kernel</literal>, the kernel's default setting will be left in place. Defaults to
- <literal>no</literal>.</para>
+ <literal>kernel</literal>, the kernel's default setting will be left in place. When unspecified,
+ the value specified in the same setting in
+ <citerefentry><refentrytitle>networkd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+ which defaults to <literal>no</literal>, will be used.</para>
</listitem>
</varlistentry>
Network.ManageForeignRoutingPolicyRules, config_parse_bool, 0, offsetof(Manager, manage_foreign_rules)
Network.ManageForeignRoutes, config_parse_bool, 0, offsetof(Manager, manage_foreign_routes)
Network.RouteTable, config_parse_route_table_names, 0, 0
+Network.IPv6PrivacyExtensions, config_parse_ipv6_privacy_extensions, 0, offsetof(Manager, ipv6_privacy_extensions)
DHCPv4.DUIDType, config_parse_duid_type, 0, offsetof(Manager, dhcp_duid)
DHCPv4.DUIDRawData, config_parse_duid_rawdata, 0, offsetof(Manager, dhcp_duid)
DHCPv6.DUIDType, config_parse_duid_type, 0, offsetof(Manager, dhcp6_duid)
*m = (Manager) {
.keep_configuration = _KEEP_CONFIGURATION_INVALID,
+ .ipv6_privacy_extensions = IPV6_PRIVACY_EXTENSIONS_NO,
.test_mode = test_mode,
.speed_meter_interval_usec = SPEED_METER_DEFAULT_TIME_INTERVAL,
.online_state = _LINK_ONLINE_STATE_INVALID,
#include "hashmap.h"
#include "networkd-link.h"
#include "networkd-network.h"
+#include "networkd-sysctl.h"
#include "ordered-set.h"
#include "set.h"
#include "time-util.h"
int ethtool_fd;
KeepConfiguration keep_configuration;
+ IPv6PrivacyExtensions ipv6_privacy_extensions;
bool test_mode;
bool enumerating;
.ipv4_accept_local = -1,
.ipv4_route_localnet = -1,
- .ipv6_privacy_extensions = IPV6_PRIVACY_EXTENSIONS_NO,
+ .ipv6_privacy_extensions = _IPV6_PRIVACY_EXTENSIONS_INVALID,
.ipv6_dad_transmits = -1,
.ipv6_hop_limit = -1,
.ipv6_proxy_ndp = -1,
#include "missing_network.h"
#include "networkd-link.h"
+#include "networkd-manager.h"
#include "networkd-network.h"
#include "networkd-sysctl.h"
#include "socket-util.h"
}
static int link_set_ipv6_privacy_extensions(Link *link) {
+ IPv6PrivacyExtensions val;
+
assert(link);
+ assert(link->manager);
if (!socket_ipv6_is_supported())
return 0;
if (!link->network)
return 0;
+ val = link->network->ipv6_privacy_extensions;
+ if (val < 0) /* If not specified, then use the global setting. */
+ val = link->manager->ipv6_privacy_extensions;
+
/* When "kernel", do not update the setting. */
- if (link->network->ipv6_privacy_extensions == IPV6_PRIVACY_EXTENSIONS_KERNEL)
+ if (val == IPV6_PRIVACY_EXTENSIONS_KERNEL)
return 0;
- return sysctl_write_ip_property_int(AF_INET6, link->ifname, "use_tempaddr", (int) link->network->ipv6_privacy_extensions);
+ return sysctl_write_ip_property_int(AF_INET6, link->ifname, "use_tempaddr", (int) val);
}
static int link_set_ipv6_accept_ra(Link *link) {
#ManageForeignRoutingPolicyRules=yes
#ManageForeignRoutes=yes
#RouteTable=
+#IPv6PrivacyExtensions=no
[DHCPv4]
#DUIDType=vendor