Calling FD_SET() in between return of select() and call to FD_ISSET()
effectively renders the whole thing useless: FD_ISSET() will always
return true no matter what select() actually did.
Fixes: a72315d2bad47 ("src: add rule batching support")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
if (ret == -1)
mnl_err_list_node_add(err_list, errno, nlh->nlmsg_seq);
+ FD_ZERO(&readfds);
+ FD_SET(fd, &readfds);
+
ret = select(fd+1, &readfds, NULL, NULL, &tv);
if (ret == -1)
return -1;
-
- FD_ZERO(&readfds);
- FD_SET(fd, &readfds);
}
return 0;
}