network/sysctl: logs when per-link IPMasquerade= setting changes the global IPv6Forwarding= setting

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.
This commit is contained in:
Yu Watanabe
2025-10-30 14:58:16 +01:00
committed by Daan De Meyer
parent 097536a49c
commit b5d63191ca
+2
View 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);