Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtnl: fix premature netlink reply receive abort #81

Merged
merged 1 commit into from
Jun 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/rtnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3087,10 +3087,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;
}
Expand Down Expand Up @@ -3186,6 +3183,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);
Expand All @@ -3199,7 +3197,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);
Expand Down