libnm: change behavior for normalizing wireguard/dummy profiles to use ipv6.method=disabled

"ipv6.method=ignore" really exists for historic reasons, from a time when
NetworkManager didn't support IPv6 autoconf and let kernel handle it.

Nowadays, we should choose an explicit mode, like "link-local" or
"disabled".

Let nm_connection_normalize() treat WireGuard and dummy profiles
different and set the IPv6 method to "disabled".
This commit is contained in:
Thomas Haller 2021-07-02 09:35:01 +02:00
parent 6185502ee9
commit bc57c79d57
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 4 additions and 4 deletions

View file

@ -1279,7 +1279,7 @@ _normalize_ip_config(NMConnection *self, GHashTable *parameters)
if (NM_IN_STRSET(type,
NM_SETTING_WIREGUARD_SETTING_NAME,
NM_SETTING_DUMMY_SETTING_NAME))
default_ip6_method = NM_SETTING_IP6_CONFIG_METHOD_IGNORE;
default_ip6_method = NM_SETTING_IP6_CONFIG_METHOD_DISABLED;
else
default_ip6_method = NM_SETTING_IP6_CONFIG_METHOD_AUTO;
}

View file

@ -3651,7 +3651,7 @@ test_roundtrip_conversion(gconstpointer test_data)
g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip.s_4), ==, "disabled");
s_ip.s_6 = NM_SETTING_IP_CONFIG(nm_connection_get_setting(con, NM_TYPE_SETTING_IP6_CONFIG));
g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip.s_6), ==, "ignore");
g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip.s_6), ==, "disabled");
g_ptr_array_add(kf_data_arr,
g_strdup_printf("[connection]\n"
@ -3670,7 +3670,7 @@ test_roundtrip_conversion(gconstpointer test_data)
"[ipv6]\n"
"addr-gen-mode=stable-privacy\n"
"dns-search=\n"
"method=ignore\n"
"method=disabled\n"
"\n"
"[proxy]\n"
"",
@ -3727,7 +3727,7 @@ test_roundtrip_conversion(gconstpointer test_data)
"[ipv6]\n"
"addr-gen-mode=stable-privacy\n"
"dns-search=\n"
"method=ignore\n"
"method=disabled\n"
"\n"
"[proxy]\n"
"",