From: Victor Julien Date: Wed, 21 May 2014 08:15:28 +0000 (+0200) Subject: nflog: improve error handling on NOBUFS X-Git-Tag: suricata-2.0.2~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0857a60fcea10c4a947fefbd0059942b71dbf80d;p=thirdparty%2Fsuricata.git nflog: improve error handling on NOBUFS Don't fall through to handle_packet on any NOBUFS condition. Make sure we catch all NOBUFS. --- diff --git a/src/source-nflog.c b/src/source-nflog.c index 86850593ac..bfac1ecd84 100644 --- a/src/source-nflog.c +++ b/src/source-nflog.c @@ -422,16 +422,19 @@ TmEcode ReceiveNFLOGLoop(ThreadVars *tv, void *data, void *slot) if (errno == EINTR || errno == EWOULDBLOCK) { /*Nothing for us to process */ continue; - } else if (errno == ENOBUFS && !ntv->nful_overrun_warned) { - int s = ntv->nlbufsiz * 2; - if (NFLOGSetnlbufsiz((void *)ntv, s)) { - SCLogWarning(SC_WARN_NFLOG_LOSING_EVENTS, - "We are losing events, " - "increasing buffer size " - "to %d", ntv->nlbufsiz); - } else { - ntv->nful_overrun_warned = 1; + } else if (errno == ENOBUFS) { + if (!ntv->nful_overrun_warned) { + int s = ntv->nlbufsiz * 2; + if (NFLOGSetnlbufsiz((void *)ntv, s)) { + SCLogWarning(SC_WARN_NFLOG_LOSING_EVENTS, + "We are losing events, " + "increasing buffer size " + "to %d", ntv->nlbufsiz); + } else { + ntv->nful_overrun_warned = 1; + } } + continue; } else { SCLogWarning(SC_WARN_NFLOG_RECV, "Read from NFLOG fd failed: %s",