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) {
/*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",

Loading…
Cancel
Save