summaryrefslogtreecommitdiff
path: root/src/devices/nm-device-macsec.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-03-05 15:23:31 +0100
committerThomas Haller <thaller@redhat.com>2018-03-12 18:03:07 +0100
commit8b75f10ebe5714e1872f0376317b85c57569db9c (patch)
treee1f20c30e4136430b0ef63ed05941ceb591c95d5 /src/devices/nm-device-macsec.c
parent34493c513426ab06221b50ec13732ff090990e7a (diff)
downloadNetworkManager-8b75f10ebe5714e1872f0376317b85c57569db9c.tar.gz
device: set properties before emitting the change notification
The change doesn't really make a difference. I thought it would, so I did it. But turns out (as the code correctly assumes), while the notifications are frozen, it's OK to leave the property still in an inconsistent state while emitting the notify signal. Still, it feels slightly more correct this way, so keep the change.
Diffstat (limited to 'src/devices/nm-device-macsec.c')
-rw-r--r--src/devices/nm-device-macsec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/devices/nm-device-macsec.c b/src/devices/nm-device-macsec.c
index 8b51f8ce60..554238a320 100644
--- a/src/devices/nm-device-macsec.c
+++ b/src/devices/nm-device-macsec.c
@@ -186,8 +186,12 @@ update_properties (NMDevice *device)
nm_device_parent_set_ifindex (device, props->parent_ifindex);
#define CHECK_PROPERTY_CHANGED(field, prop) \
- if (props->field != priv->props.field) \
- _notify (self, prop)
+ G_STMT_START { \
+ if (priv->props.field != props->field) { \
+ priv->props.field = props->field; \
+ _notify (self, prop); \
+ } \
+ } G_STMT_END
CHECK_PROPERTY_CHANGED (sci, PROP_SCI);
CHECK_PROPERTY_CHANGED (cipher_suite, PROP_CIPHER_SUITE);
@@ -202,7 +206,6 @@ update_properties (NMDevice *device)
CHECK_PROPERTY_CHANGED (scb, PROP_SCB);
CHECK_PROPERTY_CHANGED (replay_protect, PROP_REPLAY_PROTECT);
- priv->props = *props;
g_object_thaw_notify ((GObject *) device);
}