[PATCH 4/5] Workaround of recvfrom() EAGAIN bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

---
 input/packet/ulogd_inppkt_ULOG.c |    2 ++
 1 file changed, 2 insertions(+)

Index: ulogd-2.0.0beta1/input/packet/ulogd_inppkt_ULOG.c
===================================================================
--- ulogd-2.0.0beta1.orig/input/packet/ulogd_inppkt_ULOG.c	2008-01-11 13:11:20.000000000 +0100
+++ ulogd-2.0.0beta1/input/packet/ulogd_inppkt_ULOG.c	2008-01-11 13:11:54.000000000 +0100
@@ -225,6 +225,8 @@
 	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), "

--
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux