core: fix signal emission for device ports

The MASTER property must be emitted on the port; while PORTS and
SLAVES on the controller.

Fixes: 9d2ed74e74 ('core: introduce device::ports property')
This commit is contained in:
Beniamino Galvani 2021-10-13 06:35:33 +02:00
parent ae4412b2fc
commit 21782d1fdb

View file

@ -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);
}
}