diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-06-08 11:17:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 11:17:18 +0200 |
commit | 22d3d32ee3f6485da93784775624c4600f594207 (patch) | |
tree | 8d678e792496b6cee7bbcbd83496289886004fd7 /lib/rtnl.c | |
parent | e43eb40aff6ff9c4dea56546a278b636eb5f40fd (diff) | |
parent | 56be30df9f46508675f0544b067927122e8418ba (diff) |
Merge pull request #81 from jow-/rtnl-fix-ack-handling
rtnl: fix premature netlink reply receive abort
Diffstat (limited to 'lib/rtnl.c')
-rw-r--r-- | lib/rtnl.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -3090,10 +3090,7 @@ cb_reply(struct nl_msg *msg, void *arg) } } - if (hdr->nlmsg_flags & NLM_F_MULTI) - s->state = STATE_CONTINUE; - else - s->state = STATE_REPLIED; + s->state = STATE_CONTINUE; return NL_SKIP; } @@ -3189,6 +3186,7 @@ uc_nl_request(uc_vm_t *vm, size_t nargs) nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, cb_reply, &st); nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, cb_done, &st); + nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, cb_done, &st); nl_cb_err(cb, NL_CB_CUSTOM, cb_error, &st); nl_send_auto_complete(sock, msg); @@ -3202,7 +3200,7 @@ uc_nl_request(uc_vm_t *vm, size_t nargs) st.state = STATE_ERROR; } } - while (st.state == STATE_CONTINUE); + while (st.state < STATE_REPLIED); nlmsg_free(msg); nl_cb_put(cb); |