diff options
author | Thomas Haller <thaller@redhat.com> | 2016-04-07 21:19:45 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-04-11 11:30:56 +0200 |
commit | 8bf635af0e174b1bb8b5e4201b82f27da7350191 (patch) | |
tree | b575bed88ff40d4c00808ec08140819afdc2103c | |
parent | 90550a276bb1c29083af29e76676a94d7d55378d (diff) | |
download | NetworkManager-8bf635af0e174b1bb8b5e4201b82f27da7350191.tar.gz |
platform: refactor calling event_seq_check()
This makes more sense with the next commit.
-rw-r--r-- | src/platform/nm-linux-platform.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 0e562d6181..4d05f2173f 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -3468,15 +3468,12 @@ do_request_one_type (NMPlatform *platform, NMPObjectType obj_type) } static void -event_seq_check (NMPlatform *platform, struct nl_msg *msg, WaitForNlResponseResult seq_result) +event_seq_check (NMPlatform *platform, guint32 seq_number, WaitForNlResponseResult seq_result) { NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform); DelayedActionWaitForNlResponseData *data; - guint32 seq_number; guint i; - seq_number = nlmsg_hdr (msg)->nlmsg_seq; - if (seq_number == 0) return; @@ -5655,6 +5652,8 @@ continue_reading: while (nlmsg_ok (hdr, n)) { nm_auto_nlmsg struct nl_msg *msg = NULL; gboolean abort_parsing = FALSE; + gboolean process_valid_msg = FALSE; + guint32 seq_number; msg = nlmsg_convert (hdr); if (!msg) { @@ -5739,7 +5738,12 @@ continue_reading: seq_result = -errsv; } else seq_result = WAIT_FOR_NL_RESPONSE_RESULT_RESPONSE_OK; - } else { + } else + process_valid_msg = TRUE; + + seq_number = nlmsg_hdr (msg)->nlmsg_seq; + + if (process_valid_msg) { /* Valid message (not checking for MULTIPART bit to * get along with broken kernels. NL_SKIP has no * effect on this. */ @@ -5749,7 +5753,7 @@ continue_reading: seq_result = WAIT_FOR_NL_RESPONSE_RESULT_RESPONSE_OK; } - event_seq_check (platform, msg, seq_result); + event_seq_check (platform, seq_number, seq_result); if (abort_parsing) goto stop; |