mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-06 11:40:32 +01:00
core: don't autocomplete non-IPv6-capable connections with IPv6 enabled
Mobile broadband and PPPoE don't yet support IPv6, so don't enable IPv6 on these connections when completing them.
This commit is contained in:
parent
bf854ebaca
commit
a4ab74d903
10 changed files with 24 additions and 14 deletions
|
|
@ -785,7 +785,8 @@ nm_utils_complete_generic (NMConnection *connection,
|
|||
const char *ctype,
|
||||
const GSList *existing,
|
||||
const char *format,
|
||||
const char *preferred)
|
||||
const char *preferred,
|
||||
gboolean default_enable_ipv6)
|
||||
{
|
||||
NMSettingConnection *s_con;
|
||||
NMSettingIP4Config *s_ip4;
|
||||
|
|
@ -826,13 +827,13 @@ nm_utils_complete_generic (NMConnection *connection,
|
|||
NULL);
|
||||
}
|
||||
|
||||
/* Add an 'auto' IPv6 setting if allowed and not preset */
|
||||
s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG);
|
||||
if (!s_ip6) {
|
||||
if (!s_ip6 && default_enable_ipv6) {
|
||||
s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new ();
|
||||
nm_connection_add_setting (connection, NM_SETTING (s_ip6));
|
||||
}
|
||||
method = nm_setting_ip6_config_get_method (s_ip6);
|
||||
if (!method) {
|
||||
if (s_ip6 && !nm_setting_ip6_config_get_method (s_ip6)) {
|
||||
g_object_set (G_OBJECT (s_ip6),
|
||||
NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO,
|
||||
NM_SETTING_IP6_CONFIG_MAY_FAIL, TRUE,
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ void nm_utils_complete_generic (NMConnection *connection,
|
|||
const char *ctype,
|
||||
const GSList *existing,
|
||||
const char *format,
|
||||
const char *preferred);
|
||||
const char *preferred,
|
||||
gboolean default_enable_ipv6);
|
||||
|
||||
#endif /* NETWORK_MANAGER_UTILS_H */
|
||||
|
|
|
|||
|
|
@ -292,7 +292,8 @@ real_complete_connection (NMModem *modem,
|
|||
NM_SETTING_CDMA_SETTING_NAME,
|
||||
existing_connections,
|
||||
_("CDMA connection %d"),
|
||||
NULL);
|
||||
NULL,
|
||||
FALSE); /* No IPv6 yet by default */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -495,7 +495,8 @@ real_complete_connection (NMModem *modem,
|
|||
NM_SETTING_GSM_SETTING_NAME,
|
||||
existing_connections,
|
||||
_("GSM connection %d"),
|
||||
NULL);
|
||||
NULL,
|
||||
FALSE); /* No IPv6 yet by default */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -367,7 +367,8 @@ real_complete_connection (NMDevice *device,
|
|||
NM_SETTING_BLUETOOTH_SETTING_NAME,
|
||||
existing_connections,
|
||||
format,
|
||||
preferred);
|
||||
preferred,
|
||||
is_dun ? FALSE : TRUE); /* No IPv6 yet for DUN */
|
||||
|
||||
setting_bdaddr = nm_setting_bluetooth_get_bdaddr (s_bt);
|
||||
if (setting_bdaddr) {
|
||||
|
|
|
|||
|
|
@ -1682,7 +1682,8 @@ real_complete_connection (NMDevice *device,
|
|||
s_pppoe ? NM_SETTING_PPPOE_SETTING_NAME : NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
existing_connections,
|
||||
s_pppoe ? _("PPPoE connection %d") : _("Wired connection %d"),
|
||||
NULL);
|
||||
NULL,
|
||||
s_pppoe ? FALSE : TRUE); /* No IPv6 by default yet for PPPoE */
|
||||
|
||||
s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED);
|
||||
if (!s_wired) {
|
||||
|
|
|
|||
|
|
@ -420,7 +420,8 @@ real_complete_connection (NMDevice *device,
|
|||
NM_SETTING_OLPC_MESH_SETTING_NAME,
|
||||
existing_connections,
|
||||
_("Mesh %d"),
|
||||
NULL);
|
||||
NULL,
|
||||
FALSE); /* No IPv6 by default */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1470,7 +1470,8 @@ real_complete_connection (NMDevice *device,
|
|||
NM_SETTING_WIRELESS_SETTING_NAME,
|
||||
existing_connections,
|
||||
format,
|
||||
str_ssid);
|
||||
str_ssid,
|
||||
TRUE);
|
||||
g_free (str_ssid);
|
||||
g_free (format);
|
||||
|
||||
|
|
|
|||
|
|
@ -677,8 +677,9 @@ try_complete_vpn (NMConnection *connection, GSList *existing, GError **error)
|
|||
NM_SETTING_VPN_SETTING_NAME,
|
||||
existing,
|
||||
_("VPN connection %d"),
|
||||
NULL);
|
||||
|
||||
NULL,
|
||||
FALSE); /* No IPv6 by default for now */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -563,7 +563,8 @@ real_complete_connection (NMDevice *device,
|
|||
NM_SETTING_WIMAX_SETTING_NAME,
|
||||
existing_connections,
|
||||
format,
|
||||
nsp_name);
|
||||
nsp_name,
|
||||
TRUE);
|
||||
g_free (format);
|
||||
g_object_set (G_OBJECT (s_wimax), NM_SETTING_WIMAX_NETWORK_NAME, nsp_name, NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue