summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-08-07 13:01:45 +0200
committerThomas Haller <thaller@redhat.com>2019-09-22 16:06:16 +0200
commit6e5ec5b6c1bae477f2718a91019cf57ee7e2db3b (patch)
tree84290e5408b4ca34e3f4c8ad90e47f7c4ce097d6
parent9a28da0f3f0abcdf575b8a7e5820acca4f710168 (diff)
downloadNetworkManager-6e5ec5b6c1bae477f2718a91019cf57ee7e2db3b.tar.gz
settings: shortcut check for whether to create auto-default wired connection
This check is only useful for devices that implement new_default_connection. We can shortcut the possibly expensive checks like have_connection_for_device(), which need to iterate all profiles.
-rw-r--r--src/settings/nm-settings.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index 1a807c3cc9..f08ffdfeb1 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -3435,7 +3435,8 @@ device_realized (NMDevice *device, GParamSpec *pspec, NMSettings *self)
/* If the device isn't managed or it already has a default wired connection,
* ignore it.
*/
- if ( !nm_device_get_managed (device, FALSE)
+ if ( !NM_DEVICE_GET_CLASS (self)->new_default_connection
+ || !nm_device_get_managed (device, FALSE)
|| g_object_get_qdata (G_OBJECT (device), _default_wired_connection_quark ())
|| have_connection_for_device (self, device)
|| nm_config_get_no_auto_default_for_device (priv->config, device))