network: fix IPv6PrivacyExtensions=kernel handling

When set to "kernel", systemd is not supposed to touch that sysctl.

5e0534f1c1, part of
https://github.com/systemd/systemd/pull/17240 forgot to handle that
case.

Fixes https://github.com/systemd/systemd/issues/18003
This commit is contained in:
Florian Klink 2020-12-23 12:57:47 +01:00 committed by Yu Watanabe
parent 7eeaf72b88
commit d3ccb1b4ba
1 changed files with 4 additions and 0 deletions

View File

@ -100,6 +100,10 @@ static int link_set_ipv6_privacy_extensions(Link *link) {
if (!link->network)
return 0;
// this is the special "kernel" value
if (link->network->ipv6_privacy_extensions == _IPV6_PRIVACY_EXTENSIONS_INVALID)
return 0;
return sysctl_write_ip_property_int(AF_INET6, link->ifname, "use_tempaddr", (int) link->network->ipv6_privacy_extensions);
}