diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2023-02-16 13:25:16 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2023-03-29 11:49:58 +0200 |
commit | ef6d8cf1a8f75b6f32e5b25664572b569d871590 (patch) | |
tree | cc51dccba11e14f8bc85e776c6b2094c48d76986 | |
parent | 1e74b755ee7a1d2f8bb602c6d8b3fd4f43101624 (diff) | |
download | NetworkManager-ef6d8cf1a8f75b6f32e5b25664572b569d871590.tar.gz |
platform: assert the seq_status is known to be unknown on sending a nl message
This guards against accidental use of a stale result.
-rw-r--r-- | src/libnm-platform/nm-linux-platform.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libnm-platform/nm-linux-platform.c b/src/libnm-platform/nm-linux-platform.c index a3b4853977..fe42a3b110 100644 --- a/src/libnm-platform/nm-linux-platform.c +++ b/src/libnm-platform/nm-linux-platform.c @@ -7059,6 +7059,8 @@ delayed_action_schedule_WAIT_FOR_RESPONSE(NMPlatform *pla .response.out_data = response_out_data, }; + nm_assert(!out_seq_result || *out_seq_result == WAIT_FOR_NL_RESPONSE_RESULT_UNKNOWN); + delayed_action_schedule( platform, nmp_netlink_protocol_info(netlink_protocol)->delayed_action_type_wait_for_response, @@ -7423,6 +7425,8 @@ _nl_send_nlmsghdr(NMPlatform *platform, nm_assert(nlhdr); + nm_assert(out_seq_result && *out_seq_result == WAIT_FOR_NL_RESPONSE_RESULT_UNKNOWN); + seq = _nlh_seq_next_get(priv, NMP_NETLINK_ROUTE); nlhdr->nlmsg_seq = seq; @@ -7481,6 +7485,8 @@ _netlink_send_nlmsg(NMPlatform *platform, guint32 seq; int nle; + nm_assert(!out_seq_result || *out_seq_result == WAIT_FOR_NL_RESPONSE_RESULT_UNKNOWN); + nlhdr = nlmsg_hdr(nlmsg); seq = _nlh_seq_next_get(priv, netlink_protocol); nlhdr->nlmsg_seq = seq; |