summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-09-27 10:23:31 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2017-09-27 10:23:31 +0200
commitbc540af3b30c2d90cd3bdab9fe72a020ed78a5aa (patch)
tree773b06b3d90e113c88a3681c48cddb41eacbd89e
parentb526b4692d484222fa41f8a114846aa2a41ad8f0 (diff)
downloadNetworkManager-bg/parent-uuid.tar.gz
device: match all UUIDs when no connection is activebg/parent-uuid
nm_device_match_parent() is called to check whether a device is compatible with a given parent (UUID or interface). Accept any UUID If there is no connection active on the device. Without this, when there is a VLAN/MACVLAN connection with a parent UUID the manager would create the device in system_create_virtual_device(), realize it and then at the next call of system_create_virtual_device() it would notice that the connection is not compatible with the device because of the parent UUID; therefore the manager would try to create again the same device, failing. https://mail.gnome.org/archives/networkmanager-list/2017-September/msg00034.html
-rw-r--r--src/devices/nm-device.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 6d51641f20..934d29fff3 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -4405,12 +4405,13 @@ nm_device_match_parent (NMDevice *self, const char *parent)
NMActiveConnection *ac;
NMConnection *connection;
- /* If the parent is a UUID, the connection matches if our parent
- * device has that connection activated.
+ /* If the parent is a UUID, the connection matches when there is
+ * no connection active on the device or when a connection with
+ * that UUID is active.
*/
ac = (NMActiveConnection *) nm_device_get_act_request (parent_device);
if (!ac)
- return FALSE;
+ return TRUE;
connection = nm_active_connection_get_applied_connection (ac);
if (!connection)