summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-04-08 12:25:41 +0200
committerThomas Haller <thaller@redhat.com>2016-04-11 11:30:56 +0200
commit90550a276bb1c29083af29e76676a94d7d55378d (patch)
tree4cc0769e73198e26a61ab57b74221ad9b523a81d
parentc59687c6b29047d618417a0e46fddf728ae7797a (diff)
downloadNetworkManager-90550a276bb1c29083af29e76676a94d7d55378d.tar.gz
platform: refactor delayed_action_wait_for_nl_response_complete()
-rw-r--r--src/platform/nm-linux-platform.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 21f89de949..0e562d6181 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -2339,8 +2339,8 @@ _support_kernel_extended_ifa_flags_get (void)
typedef struct {
guint32 seq_number;
- gint64 timeout_abs_ns;
WaitForNlResponseResult seq_result;
+ gint64 timeout_abs_ns;
WaitForNlResponseResult *out_seq_result;
} DelayedActionWaitForNlResponseData;
@@ -2814,7 +2814,6 @@ delayed_action_wait_for_nl_response_complete (NMPlatform *platform,
{
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
DelayedActionWaitForNlResponseData *data;
- WaitForNlResponseResult *out_seq_result;
nm_assert (NM_FLAGS_HAS (priv->delayed_action.flags, DELAYED_ACTION_TYPE_WAIT_FOR_NL_RESPONSE));
nm_assert (idx < priv->delayed_action.list_wait_for_nl_response->len);
@@ -2824,16 +2823,12 @@ delayed_action_wait_for_nl_response_complete (NMPlatform *platform,
_LOGt_delayed_action (DELAYED_ACTION_TYPE_WAIT_FOR_NL_RESPONSE, data, "complete");
- out_seq_result = data->out_seq_result;
-
- g_array_remove_index_fast (priv->delayed_action.list_wait_for_nl_response, idx);
- /* Note: @data is invalidated at this point */
-
- if (priv->delayed_action.list_wait_for_nl_response->len <= 0)
+ if (priv->delayed_action.list_wait_for_nl_response->len <= 1)
priv->delayed_action.flags &= ~DELAYED_ACTION_TYPE_WAIT_FOR_NL_RESPONSE;
+ if (data->out_seq_result)
+ *data->out_seq_result = seq_result;
- if (out_seq_result)
- *out_seq_result = seq_result;
+ g_array_remove_index_fast (priv->delayed_action.list_wait_for_nl_response, idx);
}
static void