[ulogd2] NFCT: avoid spamming report about netlink overruns
Pablo Neira
netfilter-cvslog-bounces at lists.netfilter.org
Wed Jul 22 20:30:02 CEST 2009
Gitweb: http://git.netfilter.org/cgi-bin/gitweb.cgi?p=ulogd2.git;a=commit;h=9315d767d8e00e84c24a46ed01cea4b0e814fc8e
commit 9315d767d8e00e84c24a46ed01cea4b0e814fc8e
Author: Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Wed Jul 22 20:28:56 2009 +0200
Commit: Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Wed Jul 22 20:28:56 2009 +0200
NFCT: avoid spamming report about netlink overruns
This patch reduces the verbosity of the log messages that report
netlink overruns.
Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
via 9315d767d8e00e84c24a46ed01cea4b0e814fc8e (commit)
from f4a480e7cb3ed06b004e9d37f803ca35a7f334e1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9315d767d8e00e84c24a46ed01cea4b0e814fc8e
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date: Wed Jul 22 20:28:56 2009 +0200
NFCT: avoid spamming report about netlink overruns
This patch reduces the verbosity of the log messages that report
netlink overruns.
Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
-----------------------------------------------------------------------
input/flow/ulogd_inpflow_NFCT.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
This patch reduces the verbosity of the log messages that report
netlink overruns.
Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
diff --git a/input/flow/ulogd_inpflow_NFCT.c b/input/flow/ulogd_inpflow_NFCT.c
index f7e84ac..8d6347f 100644
--- a/input/flow/ulogd_inpflow_NFCT.c
+++ b/input/flow/ulogd_inpflow_NFCT.c
@@ -650,12 +650,18 @@ static int setnlbufsiz(struct ulogd_pluginstance *upi, int size)
{
struct nfct_pluginstance *cpi =
(struct nfct_pluginstance *)upi->private;
+ static int warned = 0;
if (size < nlsockbufmaxsize_ce(upi->config_kset).u.value) {
cpi->nlbufsiz = nfnl_rcvbufsiz(nfct_nfnlh(cpi->cth), size);
return 1;
}
+ /* we have already warned the user, do not keep spamming */
+ if (warned)
+ return 0;
+
+ warned = 1;
ulogd_log(ULOGD_NOTICE, "Maximum buffer size (%d) in NFCT has been "
"reached. Please, consider rising "
"`netlink_socket_buffer_size` and "
@@ -670,6 +676,7 @@ static int read_cb_nfct(int fd, unsigned int what, void *param)
struct ulogd_pluginstance *upi = container_of(param,
struct ulogd_pluginstance,
private);
+ static int warned = 0;
if (!(what & ULOGD_FD_READ))
return 0;
@@ -684,7 +691,8 @@ static int read_cb_nfct(int fd, unsigned int what, void *param)
"increasing buffer size "
"to %d\n", cpi->nlbufsiz);
}
- } else {
+ } else if (!warned) {
+ warned = 1;
ulogd_log(ULOGD_NOTICE,
"We are losing events. Please, "
"consider using the clauses "
More information about the netfilter-cvslog
mailing list