]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
nflog: improve error handling on NOBUFS
authorVictor Julien <victor@inliniac.net>
Wed, 21 May 2014 08:15:28 +0000 (10:15 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 23 May 2014 10:42:52 +0000 (12:42 +0200)
Don't fall through to handle_packet on any NOBUFS condition. Make
sure we catch all NOBUFS.

src/source-nflog.c

index 86850593acfa6bb61778d16308292aaa75291bc3..bfac1ecd849a3e264a1896ace8f01a0b25cf371c 100644 (file)
@@ -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",