device: only remember "forwarding" sysctl the first time in _dev_ipac6_start()

Fixes: 4c48301594 ('device: don't reset "net.ipv6.conf.$IFACE.forwarding"')
This commit is contained in:
Thomas Haller 2023-06-08 10:14:33 +02:00
parent 029e651551
commit 6050da93bd
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -11895,7 +11895,7 @@ _dev_ipac6_start(NMDevice *self)
sysctl_value = nm_device_sysctl_ip_conf_get(self, AF_INET6, "forwarding");
if (!nm_streq0(sysctl_value, "1")) {
if (sysctl_value) {
if (sysctl_value && !g_hash_table_contains(priv->ip6_saved_properties, "forwarding")) {
g_hash_table_insert(priv->ip6_saved_properties,
"forwarding",
g_steal_pointer(&sysctl_value));