diff --git a/man/NetworkManager.conf.xml.in b/man/NetworkManager.conf.xml.in index 054f84202b..3de964023e 100644 --- a/man/NetworkManager.conf.xml.in +++ b/man/NetworkManager.conf.xml.in @@ -208,6 +208,20 @@ no-auto-default=* + + assume-ipv6ll-only + + + Specify devices for which NetworkManager will try to + generate a connection based on initial configuration when + the device only has an IPv6 link-local address. + + See for the syntax how to + specify a device. + + + + configure-and-quit diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 35418ccb17..97e2c847a8 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -2172,6 +2172,20 @@ nm_device_generate_connection (NMDevice *self, NMDevice *master) connection = NULL; } + /* Ignore any IPv6LL-only, not master connections without slaves, + * unless they are in the assume-ipv6ll-only list. + */ + if ( connection + && g_strcmp0 (ip4_method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED) == 0 + && g_strcmp0 (ip6_method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0 + && !nm_setting_connection_get_master (NM_SETTING_CONNECTION (s_con)) + && !priv->slaves + && !nm_config_data_get_assume_ipv6ll_only (nm_config_get_data (nm_config_get ()), self)) { + _LOGD (LOGD_DEVICE, "ignoring generated connection (IPv6LL-only and not in master-slave relationship)"); + g_object_unref (connection); + connection = NULL; + } + return connection; } diff --git a/src/nm-config-data.c b/src/nm-config-data.c index 2142670ba5..41995a043f 100644 --- a/src/nm-config-data.c +++ b/src/nm-config-data.c @@ -46,6 +46,7 @@ typedef struct { } no_auto_default; GSList *ignore_carrier; + GSList *assume_ipv6ll_only; char *dns_mode; char *rc_manager; @@ -160,6 +161,15 @@ nm_config_data_get_ignore_carrier (const NMConfigData *self, NMDevice *device) return nm_device_spec_match_list (device, NM_CONFIG_DATA_GET_PRIVATE (self)->ignore_carrier); } +gboolean +nm_config_data_get_assume_ipv6ll_only (const NMConfigData *self, NMDevice *device) +{ + g_return_val_if_fail (NM_IS_CONFIG_DATA (self), FALSE); + g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); + + return nm_device_spec_match_list (device, NM_CONFIG_DATA_GET_PRIVATE (self)->assume_ipv6ll_only); +} + /************************************************************************/ static gboolean @@ -328,6 +338,7 @@ finalize (GObject *gobject) g_free (priv->rc_manager); g_slist_free_full (priv->ignore_carrier, g_free); + g_slist_free_full (priv->assume_ipv6ll_only, g_free); g_key_file_unref (priv->keyfile); @@ -361,6 +372,7 @@ constructed (GObject *object) priv->rc_manager = g_key_file_get_value (priv->keyfile, "main", "rc-manager", NULL); priv->ignore_carrier = nm_config_get_device_match_spec (priv->keyfile, "main", "ignore-carrier"); + priv->assume_ipv6ll_only = nm_config_get_device_match_spec (priv->keyfile, "main", "assume-ipv6ll-only"); G_OBJECT_CLASS (nm_config_data_parent_class)->constructed (object); } diff --git a/src/nm-config-data.h b/src/nm-config-data.h index ea99931cf8..a8182f2839 100644 --- a/src/nm-config-data.h +++ b/src/nm-config-data.h @@ -92,6 +92,7 @@ const char *nm_config_data_get_dns_mode (const NMConfigData *self); const char *nm_config_data_get_rc_manager (const NMConfigData *self); gboolean nm_config_data_get_ignore_carrier (const NMConfigData *self, NMDevice *device); +gboolean nm_config_data_get_assume_ipv6ll_only (const NMConfigData *self, NMDevice *device); G_END_DECLS