summaryrefslogtreecommitdiffstats
path: root/src/stats-mode.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-01-03 15:51:48 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-01-03 15:51:48 +0000
commitc41a0d3efc957505e72067e99a873ce66be0834a (patch)
tree31202265c1acd117df130ef0e9b466a005e8cabe /src/stats-mode.c
parentd6978c9faadf9552bcb522d56d40c8aefa2e503e (diff)
o add support for connection logging to the statistics mode via Logfile
o minor irrelevant fixes for uncommon error paths and fix several typos o use LOG_INFO for connection logging, use LOG_NOTICE for other information o minor error handling updates
Diffstat (limited to 'src/stats-mode.c')
-rw-r--r--src/stats-mode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/stats-mode.c b/src/stats-mode.c
index 1d68e02..e817c4e 100644
--- a/src/stats-mode.c
+++ b/src/stats-mode.c
@@ -88,6 +88,8 @@ static int local_handler_stats(int fd, int type, void *data)
static void dump_stats(struct nf_conntrack *ct)
{
+ nfct_attr_unset(ct, ATTR_TIMEOUT);
+
if (cache_update_force(STATE_STATS(cache), ct))
debug_ct(ct, "resync entry");
}
@@ -140,6 +142,8 @@ static void overrun_stats()
static void event_new_stats(struct nf_conntrack *ct)
{
+ nfct_attr_unset(ct, ATTR_TIMEOUT);
+
if (cache_add(STATE_STATS(cache), ct)) {
debug_ct(ct, "cache new");
} else {
@@ -153,6 +157,8 @@ static void event_new_stats(struct nf_conntrack *ct)
static void event_update_stats(struct nf_conntrack *ct)
{
+ nfct_attr_unset(ct, ATTR_TIMEOUT);
+
if (!cache_update_force(STATE_STATS(cache), ct)) {
debug_ct(ct, "can't update");
return;
@@ -162,8 +168,11 @@ static void event_update_stats(struct nf_conntrack *ct)
static int event_destroy_stats(struct nf_conntrack *ct)
{
+ nfct_attr_unset(ct, ATTR_TIMEOUT);
+
if (cache_del(STATE_STATS(cache), ct)) {
debug_ct(ct, "cache destroy");
+ dlog_ct(STATE(stats_log), ct);
return 1;
} else {
debug_ct(ct, "can't destroy!");