- dump->status = nl_sock_send__(dump->sock, request,
- nl_sock_allocate_seq(dump->sock, 1), true);
- dump->seq = nl_msg_nlmsghdr(request)->nlmsg_seq;
-}
-
-/* Helper function for nl_dump_next(). */
-static int
-nl_dump_recv(struct nl_dump *dump)
-{
- struct nlmsghdr *nlmsghdr;
- int retval;
-
- retval = nl_sock_recv__(dump->sock, &dump->buffer, true);
- if (retval) {
- return retval == EINTR ? EAGAIN : retval;
- }
-
- nlmsghdr = nl_msg_nlmsghdr(&dump->buffer);
- if (dump->seq != nlmsghdr->nlmsg_seq) {
- VLOG_DBG_RL(&rl, "ignoring seq %#"PRIx32" != expected %#"PRIx32,
- nlmsghdr->nlmsg_seq, dump->seq);
- return EAGAIN;
- }
-
- if (nl_msg_nlmsgerr(&dump->buffer, &retval)) {
- VLOG_INFO_RL(&rl, "netlink dump request error (%s)",
- ovs_strerror(retval));
- return retval && retval != EAGAIN ? retval : EPROTO;
- }
-
- return 0;
+ status = nl_sock_send__(dump->sock, request,
+ nl_sock_allocate_seq(dump->sock, 1), true);
+ atomic_init(&dump->status, status << 1);
+ dump->nl_seq = nl_msg_nlmsghdr(request)->nlmsg_seq;
+ dump->status_seq = seq_create();