mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 06:28:05 +02:00
device: match all UUIDs when no connection is active
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
This commit is contained in:
parent
d2e4a2f639
commit
6a5363bc8b
1 changed files with 4 additions and 3 deletions
|
|
@ -4404,12 +4404,13 @@ nm_device_match_parent (NMDevice *self, const char *parent)
|
|||
if (nm_utils_is_uuid (parent)) {
|
||||
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.
|
||||
*/
|
||||
connection = nm_device_get_applied_connection (self);
|
||||
if (!connection)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
|
||||
if (!nm_streq0 (parent, nm_connection_get_uuid (connection)))
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue