From 21782d1fdb9be3ad1454ed04d960dcf856288f18 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 13 Oct 2021 06:35:33 +0200 Subject: [PATCH] core: fix signal emission for device ports The MASTER property must be emitted on the port; while PORTS and SLAVES on the controller. Fixes: 9d2ed74e74f4 ('core: introduce device::ports property') --- src/core/devices/nm-device.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 829efae4fb..9197124d9a 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -6798,8 +6798,10 @@ nm_device_slave_notify_enslave(NMDevice *self, gboolean success) priv->is_enslaved = TRUE; - nm_clear_pointer(&priv->ports_variant, g_variant_unref); - nm_gobject_notify_together(self, PROP_MASTER, PROP_PORTS, PROP_SLAVES); + _notify(self, PROP_MASTER); + + nm_clear_pointer(&NM_DEVICE_GET_PRIVATE(priv->master)->ports_variant, g_variant_unref); + nm_gobject_notify_together(priv->master, PROP_PORTS, PROP_SLAVES); } else if (activating) { _LOGW(LOGD_DEVICE, "Activation: connection '%s' could not be enslaved", @@ -6863,8 +6865,11 @@ nm_device_slave_notify_release(NMDevice *self, NMDeviceStateReason reason) if (priv->is_enslaved) { priv->is_enslaved = FALSE; - nm_clear_pointer(&priv->ports_variant, g_variant_unref); - nm_gobject_notify_together(self, PROP_MASTER, PROP_PORTS, PROP_SLAVES); + + _notify(self, PROP_MASTER); + + nm_clear_pointer(&NM_DEVICE_GET_PRIVATE(priv->master)->ports_variant, g_variant_unref); + nm_gobject_notify_together(priv->master, PROP_PORTS, PROP_SLAVES); } }