From: Stephen Hemminger Date: Mon, 13 Jul 2009 17:15:23 +0000 (-0700) Subject: Fix flushing of large number of entries X-Git-Tag: v2.6.31~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d8240f8d95dfdc276dcf447623129fb5ccedcd6;p=thirdparty%2Fiproute2.git Fix flushing of large number of entries Checking for errors would cause some responses to be lost. --- diff --git a/lib/libnetlink.c b/lib/libnetlink.c index 5ae64f7ea..b68e2fdb0 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -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;