diff options
author | /C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org> | 2005-10-05 16:33:52 +0000 |
---|---|---|
committer | /C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org> | 2005-10-05 16:33:52 +0000 |
commit | f179e8af468c573d4a643fcd38980e0beeeecdbc (patch) | |
tree | 55aa7d9278cdd7a6f9b6054bd3408b19b078c354 /src | |
parent | 2b90455785ce4d4b304407994e379068df80aefd (diff) | |
download | conntrack-tools-f179e8af468c573d4a643fcd38980e0beeeecdbc.tar.gz conntrack-tools-f179e8af468c573d4a643fcd38980e0beeeecdbc.zip |
o Fix up counters
o Fix up compilation (IPS_* stuff missing), still need a proper fix
Diffstat (limited to 'src')
-rw-r--r-- | src/conntrack.c | 2 | ||||
-rw-r--r-- | src/libct.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/conntrack.c b/src/conntrack.c index 3731d0e..1d5227e 100644 --- a/src/conntrack.c +++ b/src/conntrack.c @@ -48,7 +48,7 @@ #include "libct_proto.h" #define PROGNAME "conntrack" -#define VERSION "0.81" +#define VERSION "0.82" #if 0 #define DEBUGP printf diff --git a/src/libct.c b/src/libct.c index 01307f2..16ec4db 100644 --- a/src/libct.c +++ b/src/libct.c @@ -134,16 +134,18 @@ static void parse_counters(struct nfattr *attr, struct ctnl_conntrack *ct, enum ctattr_type parent) { struct nfattr *tb[CTA_COUNTERS_MAX]; + int dir = (parent == CTA_COUNTERS_ORIG ? CTNL_DIR_REPLY + : CTNL_DIR_ORIGINAL); memset(tb, 0, CTA_COUNTERS_MAX*sizeof(struct nfattr *)); nfnl_parse_nested(tb, CTA_COUNTERS_MAX, attr); if (tb[CTA_COUNTERS_PACKETS-1]) - ct->counters[CTNL_DIR_ORIGINAL].packets + ct->counters[dir].packets = __be64_to_cpu(*(u_int64_t *) NFA_DATA(tb[CTA_COUNTERS_PACKETS-1])); if (tb[CTA_COUNTERS_BYTES-1]) - ct->counters[CTNL_DIR_ORIGINAL].bytes + ct->counters[dir].bytes = __be64_to_cpu(*(u_int64_t *) NFA_DATA(tb[CTA_COUNTERS_BYTES-1])); } |