summary refs log tree commit diff
path: root/libnm-glib/nm-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-glib/nm-device.c')
-rw-r--r--libnm-glib/nm-device.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c
index 3b39c9ec..f06c1e4a 100644
--- a/libnm-glib/nm-device.c
+++ b/libnm-glib/nm-device.c
@@ -120,12 +120,10 @@ demarshal_ip4_config (NMObject *object, GParamSpec *pspec, GValue *value, gpoint
 	NMIP4Config *config = NULL;
 	DBusGConnection *connection;
 
-	if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
-		return FALSE;
-
-	priv->got_ip4_config = TRUE;
-
 	if (value) {
+		if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
+			return FALSE;
+
 		path = g_value_get_boxed (value);
 		if (path) {
 			config = NM_IP4_CONFIG (_nm_object_cache_get (path));
@@ -136,6 +134,8 @@ demarshal_ip4_config (NMObject *object, GParamSpec *pspec, GValue *value, gpoint
 		}
 	}
 
+	priv->got_ip4_config = TRUE;
+
 	if (priv->ip4_config) {
 		g_object_unref (priv->ip4_config);
 		priv->ip4_config = NULL;
@@ -156,12 +156,10 @@ demarshal_dhcp4_config (NMObject *object, GParamSpec *pspec, GValue *value, gpoi
 	NMDHCP4Config *config = NULL;
 	DBusGConnection *connection;
 
-	if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
-		return FALSE;
-
-	priv->got_dhcp4_config = TRUE;
-
 	if (value) {
+		if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
+			return FALSE;
+
 		path = g_value_get_boxed (value);
 		if (path) {
 			config = NM_DHCP4_CONFIG (_nm_object_cache_get (path));
@@ -172,6 +170,8 @@ demarshal_dhcp4_config (NMObject *object, GParamSpec *pspec, GValue *value, gpoi
 		}
 	}
 
+	priv->got_dhcp4_config = TRUE;
+
 	if (priv->dhcp4_config) {
 		g_object_unref (priv->dhcp4_config);
 		priv->dhcp4_config = NULL;
@@ -192,12 +192,10 @@ demarshal_ip6_config (NMObject *object, GParamSpec *pspec, GValue *value, gpoint
 	NMIP6Config *config = NULL;
 	DBusGConnection *connection;
 
-	if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
-		return FALSE;
-
-	priv->got_ip6_config = TRUE;
-
 	if (value) {
+		if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
+			return FALSE;
+
 		path = g_value_get_boxed (value);
 		if (path) {
 			config = NM_IP6_CONFIG (_nm_object_cache_get (path));
@@ -208,6 +206,8 @@ demarshal_ip6_config (NMObject *object, GParamSpec *pspec, GValue *value, gpoint
 		}
 	}
 
+	priv->got_ip6_config = TRUE;
+
 	if (priv->ip6_config) {
 		g_object_unref (priv->ip6_config);
 		priv->ip6_config = NULL;
@@ -228,12 +228,10 @@ demarshal_dhcp6_config (NMObject *object, GParamSpec *pspec, GValue *value, gpoi
 	NMDHCP6Config *config = NULL;
 	DBusGConnection *connection;
 
-	if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
-		return FALSE;
-
-	priv->got_dhcp6_config = TRUE;
-
 	if (value) {
+		if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH))
+			return FALSE;
+
 		path = g_value_get_boxed (value);
 		if (path) {
 			config = NM_DHCP6_CONFIG (_nm_object_cache_get (path));
@@ -244,6 +242,8 @@ demarshal_dhcp6_config (NMObject *object, GParamSpec *pspec, GValue *value, gpoi
 		}
 	}
 
+	priv->got_dhcp6_config = TRUE;
+
 	if (priv->dhcp6_config) {
 		g_object_unref (priv->dhcp6_config);
 		priv->dhcp6_config = NULL;
@@ -1217,7 +1217,8 @@ nm_device_get_state (NMDevice *device)
  *
  * Gets the #NMActiveConnection object which owns this device during activation.
  *
- * Returns: the #NMActiveConnection
+ * Returns: (transfer none): the #NMActiveConnection or %NULL if the device is
+ * not part of an active connection
  **/
 NMActiveConnection *
 nm_device_get_active_connection (NMDevice *device)