]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/sysctl: logs when per-link IPMasquerade= setting changes the global IPv6Forwa...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 23 Oct 2025 02:19:52 +0000 (11:19 +0900)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 30 Oct 2025 13:58:16 +0000 (14:58 +0100)
All other cases, settings on different interfaces are completely
independent. But IPMasquerade=yes on an interface enables the global
IPv6Forwarding= setting, and hence affects other interfaces.
Let's log about that.

Prompted by https://github.com/systemd/systemd/issues/39304#issuecomment-3430382233.

src/network/networkd-sysctl.c

index 6433a77a5e635206971a6307548d3631bf01bcfb..b29d49d79db330d522ed016c0fe4ed3bed63345f 100644 (file)
@@ -377,6 +377,8 @@ static int link_set_ip_forwarding(Link *link, int family) {
         if (FLAGS_SET(link->network->ip_masquerade, AF_TO_ADDRESS_FAMILY(family)) &&
             link->manager->ip_forwarding[family == AF_INET6] < 0) {
 
+                log_link_notice(link, "IPMasquerade= is enabled on the interface, enabling the global IPv6Forwarding= setting, which may affect NDisc and DHCPv6 client on other interfaces.");
+
                 link->manager->ip_forwarding[family == AF_INET6] = true;
                 manager_set_ip_forwarding(link->manager, family);