From aad5ce1e12f9f969b7a2220e7811b8dd16fd12e2 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 3 Jun 2019 16:23:18 +0200 Subject: device: fix matching parent device by connection UUID 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()') --- src/devices/nm-device.c | 8 +++----- 1 file 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 */ -- cgit v1.2.1