about summary refs log tree commit diff
path: root/src/nm-device-vlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nm-device-vlan.c')
-rw-r--r--src/nm-device-vlan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nm-device-vlan.c b/src/nm-device-vlan.c
index 14be849f..b9c93234 100644
--- a/src/nm-device-vlan.c
+++ b/src/nm-device-vlan.c
@@ -643,17 +643,17 @@ nm_device_vlan_new (const char *udi, const char *iface, NMDevice *parent)
 			g_object_unref (device);
 			return NULL;
 		}
-		priv->vlan_id = vlan_id;
 
 		if (   parent_ifindex < 0
 		    || parent_ifindex != nm_device_get_ip_ifindex (parent)
-		    || priv->vlan_id < 0) {
+		    || vlan_id < 0) {
 			nm_log_warn (LOGD_DEVICE, "(%s): VLAN parent ifindex (%d) or VLAN ID (%d) invalid.",
 			             iface, parent_ifindex, priv->vlan_id);
 			g_object_unref (device);
 			return NULL;
 		}
 
+		priv->vlan_id = vlan_id;
 		priv->parent = g_object_ref (parent);
 		priv->parent_state_id = g_signal_connect (priv->parent,
 		                                          "state-changed",