summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/conntrack.c2
-rw-r--r--src/libct.c6
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]));
}