summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net </C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net>2008-01-12 14:51:49 +0000
committer/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net </C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net>2008-01-12 14:51:49 +0000
commit3e0efc974d3ef5f5d768def9ea151138b1ea443a (patch)
treebd7966515d0a7f787e001279b8ef2c28debf47c2 /input
parent8a59c44b682bcba890426325412445c87435ffc4 (diff)
[PATCH 4/5] Workaround of recvfrom() EAGAIN bug
This is a workaround which prevents ulogd from logging each time when recvfrom() returns error because of EAGAIN. Since the netlink socket is now O_NONBLOCK, we probably run into the following bug: http://bugzilla.kernel.org/show_bug.cgi?id=5498 which causes recvfrom() get an error when select() had a good return, whenever select() receives a packet with a bad checksum. ipulog_read() always has this problem once after every successful ipulog_read(). Signed-off-by: Peter Warasin <peter@endian.com> [Note: this is not a workaround but correct handling of EAGAIN on a non-blocking socket. -Patrick]
Diffstat (limited to 'input')
-rw-r--r--input/packet/ulogd_inppkt_ULOG.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/input/packet/ulogd_inppkt_ULOG.c b/input/packet/ulogd_inppkt_ULOG.c
index 3a94700..cf44474 100644
--- a/input/packet/ulogd_inppkt_ULOG.c
+++ b/input/packet/ulogd_inppkt_ULOG.c
@@ -225,6 +225,8 @@ static int ulog_read_cb(int fd, unsigned int what, void *param)
while ((len = ipulog_read(u->libulog_h, u->libulog_buf,
upi->config_kset->ces[0].u.value, 1))) {
if (len <= 0) {
+ if (errno == EAGAIN)
+ break;
/* this is not supposed to happen */
ulogd_log(ULOGD_ERROR, "ipulog_read = %d! "
"ipulog_errno = %d (%s), "