summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-09-29 14:29:35 +0200
committerThomas Haller <thaller@redhat.com>2022-09-29 14:40:24 +0200
commitcd2f8945c942e591af03ff867ebfedc5f74f32e9 (patch)
tree5481fa133e340b6633e5e655c8305035e2511e29
parent07e0ab48d194b8bd6663a34887c2e753720ae4d3 (diff)
parent45eab7b2d8ab5960c297696081be00214d7b4f95 (diff)
downloadNetworkManager-cd2f8945c942e591af03ff867ebfedc5f74f32e9.tar.gz
device: merge branch 'th/mlag-bonding-slb' (part 1)
Small spin-off from merge request with minor cleanups. Merge early. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1385
-rw-r--r--src/core/devices/nm-device.c16
-rw-r--r--src/core/nm-active-connection.c32
2 files changed, 25 insertions, 23 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index 7985362ac0..5e503cda58 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -6198,7 +6198,8 @@ nm_device_master_release_slave(NMDevice *self,
NMDevicePrivate *priv;
NMDevicePrivate *slave_priv;
SlaveInfo *info;
- gs_unref_object NMDevice *self_free = NULL;
+ gs_unref_object NMDevice *self_free = NULL;
+ gs_unref_object NMDevice *slave_free = NULL;
g_return_if_fail(NM_DEVICE(self));
g_return_if_fail(NM_DEVICE(slave));
@@ -6241,14 +6242,15 @@ nm_device_master_release_slave(NMDevice *self,
/* keep both alive until the end of the function.
* Transfers ownership from slave_priv->master. */
- self_free = self;
+ nm_assert(self == slave_priv->master);
+ self_free = g_steal_pointer(&slave_priv->master);
- c_list_unlink(&info->lst_slave);
- slave_priv->master = NULL;
+ nm_assert(slave == info->slave);
+ slave_free = g_steal_pointer(&info->slave);
+ c_list_unlink(&info->lst_slave);
g_signal_handler_disconnect(slave, info->watch_id);
- g_object_unref(slave);
- g_slice_free(SlaveInfo, info);
+ nm_g_slice_free(info);
if (c_list_is_empty(&priv->slaves)) {
_active_connection_set_state_flags_full(self,
@@ -16112,7 +16114,7 @@ nm_device_queue_state(NMDevice *self, NMDeviceState state, NMDeviceStateReason r
/* We should only ever have one delayed state transition at a time */
if (priv->queued_state.id) {
- _LOGW(LOGD_DEVICE,
+ _LOGD(LOGD_DEVICE,
"queue-state[%s, reason:%s, id:%u]: %s",
nm_device_state_to_string(priv->queued_state.state),
nm_device_state_reason_to_string_a(priv->queued_state.reason),
diff --git a/src/core/nm-active-connection.c b/src/core/nm-active-connection.c
index 49568f7c7a..4488d909e3 100644
--- a/src/core/nm-active-connection.c
+++ b/src/core/nm-active-connection.c
@@ -116,22 +116,22 @@ static void auth_complete(NMActiveConnection *self, gboolean result, const char
#define _NMLOG_DOMAIN LOGD_DEVICE
#define _NMLOG_PREFIX_NAME "active-connection"
-#define _NMLOG(level, ...) \
- G_STMT_START \
- { \
- char _sbuf[64]; \
- NMActiveConnectionPrivate *_priv = self ? NM_ACTIVE_CONNECTION_GET_PRIVATE(self) : NULL; \
- \
- nm_log((level), \
- _NMLOG_DOMAIN, \
- (_priv && _priv->device) ? nm_device_get_iface(_priv->device) : NULL, \
- (_priv && _priv->applied_connection) \
- ? nm_connection_get_uuid(_priv->applied_connection) \
- : NULL, \
- "%s%s: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
- _NMLOG_PREFIX_NAME, \
- self ? nm_sprintf_buf(_sbuf, "[%p]", self) : "" _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
- } \
+#define _NMLOG(level, ...) \
+ G_STMT_START \
+ { \
+ char _sbuf[64]; \
+ NMActiveConnectionPrivate *_priv = self ? NM_ACTIVE_CONNECTION_GET_PRIVATE(self) : NULL; \
+ \
+ nm_log((level), \
+ _NMLOG_DOMAIN, \
+ (_priv && _priv->device) ? nm_device_get_iface(_priv->device) : NULL, \
+ (_priv && _priv->applied_connection) \
+ ? nm_connection_get_uuid(_priv->applied_connection) \
+ : NULL, \
+ "%s%s: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
+ _NMLOG_PREFIX_NAME, \
+ NM_HASH_OBFUSCATE_PTR_STR(self, _sbuf) _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
+ } \
G_STMT_END
/*****************************************************************************/