From d7c98dc3512b6ca682466e50168dacac964366cd Mon Sep 17 00:00:00 2001 From: laforge Date: Tue, 3 Jul 2001 14:36:19 +0000 Subject: added fix to handle read errors (prevent endless packet logs) --- ulogd/Changes | 3 +++ ulogd/ulogd.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'ulogd') diff --git a/ulogd/Changes b/ulogd/Changes index e9248d0..e3474ff 100644 --- a/ulogd/Changes +++ b/ulogd/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/ulogd.c b/ulogd/ulogd.c index a62331a..cec4bf8 100644 --- a/ulogd/ulogd.c +++ b/ulogd/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"); -- cgit v1.2.3