]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
added fix to handle read errors (prevent endless packet logs)
authorlaforge <laforge>
Tue, 3 Jul 2001 14:36:19 +0000 (14:36 +0000)
committerlaforge <laforge>
Tue, 3 Jul 2001 14:36:19 +0000 (14:36 +0000)
Changes
ulogd.c

diff --git a/Changes b/Changes
index e9248d04f69945d32b6bf63a895205f455973d04..e3474ff65f20b8fd5929ea63d96f35fa54303817 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+Version 0.97
+- added error handling after ipulog_read() to prevent endless loops
+
 Version 0.96
 - support for old mysql versions (Alexander Janssen)
 - support for dotted-quad IP addresses in MySQL (Alexander Janssen)
diff --git a/ulogd.c b/ulogd.c
index a62331ab5ad280f0e86cf2bd578d3a9bf791ec8a..cec4bf8b73bb6d4547da7eb52e4db7db9305b006 100644 (file)
--- a/ulogd.c
+++ b/ulogd.c
@@ -1,6 +1,6 @@
-/* ulogd, Version $Revision: 1.17 $
+/* ulogd, Version $Revision: 1.18 $
  *
- * $Id: ulogd.c,v 1.17 2001/06/14 19:25:25 laforge Exp $
+ * $Id: ulogd.c,v 1.18 2001/06/17 20:08:30 laforge Exp $
  *
  * userspace logging daemon for the netfilter ULOG target
  * of the linux 2.4 netfilter subsystem.
@@ -579,6 +579,13 @@ int main(int argc, char* argv[])
                /* endless loop receiving packets and handling them over to
                 * handle_packet */
                while(len = ipulog_read(libulog_h, libulog_buf, MYBUFSIZ, 1)) {
+                       if (len < 0) {
+                               /* an error during read occurred,
+                                * we may want some rate limiting here */
+                               ulogd_log(LOG_ERROR, 
+                                         ipulog_strerror(ipulog_errno));
+                               continue;
+                       }
                        while(upkt = ipulog_get_packet(libulog_h,
                                                       libulog_buf, len)) {
                                DEBUGP("==> packet received\n");