-read:
- recv_bytes = recvmsg(nlsk_fd, &msg, 0);
- if (recv_bytes < 0)
- return -1;
- for (nh = (struct nlmsghdr *)buf;
- NLMSG_OK(nh, (unsigned int)recv_bytes);
- nh = NLMSG_NEXT(nh, recv_bytes)) {
- /*
- * Multi-part messages and their following DONE message have the
- * NLM_F_MULTI flag set. Make note, in order to read the DONE
- * message afterwards.
- */
- if (nh->nlmsg_flags & NLM_F_MULTI)
- multipart = 1;
- if (nh->nlmsg_type == NLMSG_ERROR) {
- struct nlmsgerr *err_data = NLMSG_DATA(nh);
+ do {
+ struct nlmsghdr *nh;
+ int recv_bytes = 0;
+
+ recv_bytes = recvmsg(nlsk_fd, &msg, 0);
+ if (recv_bytes < 0)
+ return -1;
+ for (nh = (struct nlmsghdr *)buf;
+ NLMSG_OK(nh, (unsigned int)recv_bytes);
+ nh = NLMSG_NEXT(nh, recv_bytes)) {
+ if (nh->nlmsg_type == NLMSG_ERROR) {
+ struct nlmsgerr *err_data = NLMSG_DATA(nh);