From ffc377ecc6ea23234f03ac0294e319ac7a1998da Mon Sep 17 00:00:00 2001 From: Wen Liang Date: Sun, 1 Oct 2023 21:25:55 -0400 Subject: [PATCH] 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: be655e6ed153 ('core: read "disable_ipv6" sysctl before nm_ip6_config_create_setting()') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1743 --- src/core/devices/nm-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 1fc85ad135..6de0375324 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -8754,7 +8754,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); } /*