From e8a2306afbcd3e328f62004af92cd21b2477f0ac Mon Sep 17 00:00:00 2001 From: Wen Liang Date: Mon, 17 Jul 2023 14:09:04 -0400 Subject: [PATCH] assume: change IPv6 method from "ignore" and "disabled" into "auto" IPv6 method "disabled" and "ignore" are not supported for loopback device, when generating the assume connection, the generated connection will fail verification. Therefore, change the IPv6 method into "auto", as a result, for loopback external connection, NM will not toggle the `disable_ipv6` sysctl setting when `systemd-sysctl` sets it into 1. https://bugzilla.redhat.com/show_bug.cgi?id=2207878 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1694 --- src/core/NetworkManagerUtils.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/NetworkManagerUtils.c b/src/core/NetworkManagerUtils.c index 35730d2b5f..8606082c35 100644 --- a/src/core/NetworkManagerUtils.c +++ b/src/core/NetworkManagerUtils.c @@ -1854,6 +1854,13 @@ nm_utils_platform_capture_ip_setting(NMPlatform *platform, method = maybe_ipv6_disabled ? NM_SETTING_IP6_CONFIG_METHOD_DISABLED : NM_SETTING_IP6_CONFIG_METHOD_IGNORE; } + + /* The IPv6 method "ignore" and "disabled" are not supported for loopback */ + if (ifindex == 1 + && NM_IN_STRSET(method, + NM_SETTING_IP6_CONFIG_METHOD_DISABLED, + NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) + method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; g_object_set(s_ip, NM_SETTING_IP_CONFIG_METHOD, method, NULL); nmp_lookup_init_object_by_ifindex(&lookup, NMP_OBJECT_TYPE_IP_ROUTE(IS_IPv4), ifindex);