about summary refs log tree commit diff
path: root/src/nm-manager.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2019-04-21 21:09:51 +0200
committerMichael Biebl <biebl@debian.org>2019-04-21 21:09:51 +0200
commit85563b7fc7ec2cd21e38debb9b28db342e2e8e7c (patch)
treecce7b0b02d28fae2df9fdf2c1804cacd1500f2d7 /src/nm-manager.c
parent9a6dcbf895f9da01768e64b73cec88c16157d91e (diff)
New upstream version 1.18.0 upstream/1.18.0
Diffstat (limited to 'src/nm-manager.c')
-rw-r--r--src/nm-manager.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 0bf6a751..40e068ac 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -27,9 +27,9 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "nm-utils/nm-c-list.h"
+#include "nm-glib-aux/nm-c-list.h"
 
-#include "nm-common-macros.h"
+#include "nm-libnm-core-intern/nm-common-macros.h"
 #include "nm-dbus-manager.h"
 #include "vpn/nm-vpn-manager.h"
 #include "devices/nm-device.h"
@@ -54,7 +54,7 @@
 #include "nm-core-internal.h"
 #include "nm-config.h"
 #include "nm-audit-manager.h"
-#include "nm-dbus-compat.h"
+#include "nm-std-aux/nm-dbus-compat.h"
 #include "nm-checkpoint.h"
 #include "nm-checkpoint-manager.h"
 #include "nm-dbus-object.h"
@@ -303,6 +303,8 @@ static const GDBusSignalInfo signal_info_state_changed;
 static const GDBusSignalInfo signal_info_device_added;
 static const GDBusSignalInfo signal_info_device_removed;
 
+static void update_connectivity_value (NMManager *self);
+
 static gboolean add_device (NMManager *self, NMDevice *device, GError **error);
 
 static void _emit_device_added_removed (NMManager *self,
@@ -1700,6 +1702,8 @@ remove_device (NMManager *self,
 	g_signal_emit (self, signals[INTERNAL_DEVICE_REMOVED], 0, device);
 	_notify (self, PROP_ALL_DEVICES);
 
+	update_connectivity_value (self);
+
 	nm_dbus_object_clear_and_unexport (&device);
 
 	check_if_startup_complete (self);
@@ -1991,6 +1995,13 @@ system_create_virtual_device (NMManager *self, NMConnection *connection)
 		g_object_unref (device);
 	}
 
+	if (!nm_device_check_unrealized_device_managed (device)) {
+		_LOG3D (LOGD_DEVICE, connection,
+		        "skip activation because virtual device '%s' is unmanaged",
+		        nm_device_get_iface (device));
+		return device;
+	}
+
 	/* Create backing resources if the device has any autoconnect connections */
 	connections = nm_settings_get_connections_clone (priv->settings, NULL,
 	                                                 NULL, NULL,
@@ -2924,6 +2935,12 @@ device_connectivity_changed (NMDevice *device,
                              GParamSpec *pspec,
                              NMManager *self)
 {
+	update_connectivity_value (self);
+}
+
+static void
+update_connectivity_value (NMManager *self)
+{
 	NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
 	NMConnectivityState best_state;
 
@@ -8283,8 +8300,8 @@ nm_manager_class_init (NMManagerClass *manager_class)
 	signals[INTERNAL_DEVICE_ADDED] =
 	    g_signal_new (NM_MANAGER_INTERNAL_DEVICE_ADDED,
 	                  G_OBJECT_CLASS_TYPE (object_class),
-	                  G_SIGNAL_RUN_FIRST, 0,
-	                  NULL, NULL, NULL,
+	                  G_SIGNAL_RUN_FIRST,
+	                  0, NULL, NULL, NULL,
 	                  G_TYPE_NONE, 1, G_TYPE_OBJECT);
 
 	/* emitted only for realized devices when a device
@@ -8300,8 +8317,8 @@ nm_manager_class_init (NMManagerClass *manager_class)
 	signals[INTERNAL_DEVICE_REMOVED] =
 	    g_signal_new (NM_MANAGER_INTERNAL_DEVICE_REMOVED,
 	                  G_OBJECT_CLASS_TYPE (object_class),
-	                  G_SIGNAL_RUN_FIRST, 0,
-	                  NULL, NULL, NULL,
+	                  G_SIGNAL_RUN_FIRST,
+	                  0, NULL, NULL, NULL,
 	                  G_TYPE_NONE, 1, G_TYPE_OBJECT);
 
 	signals[ACTIVE_CONNECTION_ADDED] =