From 0857a60fcea10c4a947fefbd0059942b71dbf80d Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 21 May 2014 10:15:28 +0200 Subject: [PATCH] nflog: improve error handling on NOBUFS Don't fall through to handle_packet on any NOBUFS condition. Make sure we catch all NOBUFS. --- src/source-nflog.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) 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", -- 2.47.3