device: negate the condition in _get_maybe_ipv6_disabled

The condition in `_get_maybe_ipv6_disabled()` is improperly set which
returns the wrong value on if an device is disabled or not when
generating the assume connection. And when
`/proc/sys/net/ipv6/conf/$DEV/disable_ipv6` is not existed (not
disabling ipv6 through sysctl setting), IPv6 is disabled by default.

Fixes: be655e6ed1 ('core: read "disable_ipv6" sysctl before nm_ip6_config_create_setting()')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1743
(cherry picked from commit ffc377ecc6)
This commit is contained in:
Wen Liang 2023-10-01 21:25:55 -04:00 committed by Beniamino Galvani
parent 1a1b26c3fe
commit fc65b8ff45

View file

@ -8740,7 +8740,7 @@ _get_maybe_ipv6_disabled(NMDevice *self)
return FALSE;
path = nm_sprintf_bufa(128, "/proc/sys/net/ipv6/conf/%s/disable_ipv6", ifname);
return (nm_platform_sysctl_get_int32(platform, NMP_SYSCTL_PATHID_ABSOLUTE(path), 0) == 0);
return (nm_platform_sysctl_get_int32(platform, NMP_SYSCTL_PATHID_ABSOLUTE(path), 1) != 0);
}
/*