]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Fix flushing of large number of entries
authorStephen Hemminger <stephen.hemminger@vyatta.com>
Mon, 13 Jul 2009 17:15:23 +0000 (10:15 -0700)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Mon, 13 Jul 2009 17:15:23 +0000 (10:15 -0700)
Checking for errors would cause some responses to be lost.

lib/libnetlink.c

index 5ae64f7ea45106e287590f676247b62a060a3bb6..b68e2fdb08412827bb48c77b9d16eb3b5058694b 100644 (file)
@@ -121,8 +121,8 @@ int rtnl_send_check(struct rtnl_handle *rth, const char *buf, int len)
        if (status < 0)
                return status;
 
-       /* Check for errors */
-       status = recv(rth->fd, resp, sizeof(resp), MSG_DONTWAIT);
+       /* Check for immediate errors */
+       status = recv(rth->fd, resp, sizeof(resp), MSG_DONTWAIT|MSG_PEEK);
        if (status < 0) {
                if (errno == EAGAIN)
                        return 0;