nflog: improve error handling on NOBUFS

Don't fall through to handle_packet on any NOBUFS condition. Make
sure we catch all NOBUFS.
pull/976/merge
Victor Julien 11 years ago
parent 4d72911e17
commit 0857a60fce

@ -422,16 +422,19 @@ TmEcode ReceiveNFLOGLoop(ThreadVars *tv, void *data, void *slot)
if (errno == EINTR || errno == EWOULDBLOCK) { if (errno == EINTR || errno == EWOULDBLOCK) {
/*Nothing for us to process */ /*Nothing for us to process */
continue; continue;
} else if (errno == ENOBUFS && !ntv->nful_overrun_warned) { } else if (errno == ENOBUFS) {
int s = ntv->nlbufsiz * 2; if (!ntv->nful_overrun_warned) {
if (NFLOGSetnlbufsiz((void *)ntv, s)) { int s = ntv->nlbufsiz * 2;
SCLogWarning(SC_WARN_NFLOG_LOSING_EVENTS, if (NFLOGSetnlbufsiz((void *)ntv, s)) {
"We are losing events, " SCLogWarning(SC_WARN_NFLOG_LOSING_EVENTS,
"increasing buffer size " "We are losing events, "
"to %d", ntv->nlbufsiz); "increasing buffer size "
} else { "to %d", ntv->nlbufsiz);
ntv->nful_overrun_warned = 1; } else {
ntv->nful_overrun_warned = 1;
}
} }
continue;
} else { } else {
SCLogWarning(SC_WARN_NFLOG_RECV, SCLogWarning(SC_WARN_NFLOG_RECV,
"Read from NFLOG fd failed: %s", "Read from NFLOG fd failed: %s",

Loading…
Cancel
Save