]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: fix IPv6PrivacyExtensions=kernel handling 18069/head
authorFlorian Klink <flokli@flokli.de>
Wed, 23 Dec 2020 11:57:47 +0000 (12:57 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 23 Dec 2020 23:54:20 +0000 (08:54 +0900)
When set to "kernel", systemd is not supposed to touch that sysctl.

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

Fixes https://github.com/systemd/systemd/issues/18003

src/network/networkd-sysctl.c

index 4ffb09eb068b2ceef03768ccd1101c976f6a920a..377fdac7223d86ea10ee2ab54e9984e514517de1 100644 (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);
 }