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
This commit is contained in:
Wen Liang 2023-07-17 14:09:04 -04:00
parent c779c22fcb
commit e8a2306afb

View file

@ -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);