The libnl documentation for nl_recvmsgs implies that it keeps reading
messages, but it only keeps parsing already received messages, which
in this case is a crucial difference.
if (err < 0)
goto out;
+ err = 1;
+
nl_cb_err(cb, NL_CB_CUSTOM, error_handler, &err);
nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finish_handler, NULL);
nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, ack_handler, &err);
- nl_recvmsgs(state->nl_handle, cb);
+ while (err > 0)
+ nl_recvmsgs(state->nl_handle, cb);
out:
nl_cb_put(cb);
out_free_msg: