summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-06-03 16:23:18 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2019-06-03 16:54:51 +0200
commitaad5ce1e12f9f969b7a2220e7811b8dd16fd12e2 (patch)
tree76e8b705c08d0650805ba75f2ad1cb234f982965
parentf4222aff0720d27264cf2d473543541f7564b050 (diff)
downloadNetworkManager-bg/fix-device-parent-match-rh1716438.tar.gz
device: fix matching parent device by connection UUIDbg/fix-device-parent-match-rh1716438
We must compare the UUID with the one on the *parent* device. Also, simplify the checks to only return TRUE at the end of function. Fixes: 27c281ac5a5c ('device: deduplicate match_parent()')
-rw-r--r--src/devices/nm-device.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 75ed5655f6..84ed214e45 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -5756,11 +5756,9 @@ nm_device_match_parent (NMDevice *self, const char *parent)
* 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 TRUE;
-
- if (!nm_streq0 (parent, nm_connection_get_uuid (connection)))
+ connection = nm_device_get_applied_connection (parent_device);
+ if ( connection
+ && !nm_streq0 (parent, nm_connection_get_uuid (connection)))
return FALSE;
} else {
/* Interface name */