summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-10-14 16:14:12 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2009-10-14 16:14:12 +0200
commit6e7166b7d396884eedbaf250f8a06864f63c07fc (patch)
treeebfd56b8e3b8d5892e6d3417b20c9a640a4c3af6
parent0b03f4b759e439edd2c3da0add08050276d7dc5f (diff)
downloadconntrack-tools-6e7166b7d396884eedbaf250f8a06864f63c07fc.tar.gz
conntrack-tools-6e7166b7d396884eedbaf250f8a06864f63c07fc.zip
conntrackd: add missing external statistics
In 0b03f4b759e439edd2c3da0add08050276d7dc5f, I forgot to increase the stats for successful cases. This patch fixes this. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/external_inject.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/external_inject.c b/src/external_inject.c
index 8e5bbea..a54bb13 100644
--- a/src/external_inject.c
+++ b/src/external_inject.c
@@ -82,6 +82,8 @@ retry:
external_inject_stat.add_fail++;
dlog(LOG_ERR, "inject-add2: %s", strerror(errno));
dlog_ct(STATE(log), ct, NFCT_O_PLAIN);
+ } else {
+ external_inject_stat.add_ok++;
}
}
@@ -90,8 +92,10 @@ static void external_inject_upd(struct nf_conntrack *ct)
int ret;
/* if we successfully update the entry, everything is OK */
- if (nl_update_conntrack(inject, ct, 0) != -1)
+ if (nl_update_conntrack(inject, ct, 0) != -1) {
+ external_inject_stat.upd_ok++;
return;
+ }
/* state entries does not exist, we have to create it */
if (errno == ENOENT) {
@@ -99,6 +103,8 @@ static void external_inject_upd(struct nf_conntrack *ct)
external_inject_stat.upd_fail++;
dlog(LOG_ERR, "inject-upd1: %s", strerror(errno));
dlog_ct(STATE(log), ct, NFCT_O_PLAIN);
+ } else {
+ external_inject_stat.upd_ok++;
}
return;
}
@@ -112,6 +118,8 @@ static void external_inject_upd(struct nf_conntrack *ct)
external_inject_stat.upd_fail++;
dlog(LOG_ERR, "inject-upd2: %s", strerror(errno));
dlog_ct(STATE(log), ct, NFCT_O_PLAIN);
+ } else {
+ external_inject_stat.upd_ok++;
}
return;
}
@@ -128,6 +136,8 @@ static void external_inject_del(struct nf_conntrack *ct)
dlog(LOG_ERR, "inject-del: %s", strerror(errno));
dlog_ct(STATE(log), ct, NFCT_O_PLAIN);
}
+ } else {
+ external_inject_stat.del_ok++;
}
}