From 7ecbef1eb3f49afc8349b3a75f22b253856e60db Mon Sep 17 00:00:00 2001 From: Ulrich Weber Date: Wed, 9 Oct 2013 12:00:01 +0200 Subject: nfct: make NFCT packet counter/length 64 bit Kernel and libnetfilter_conntrack counters are 64bit, so use 64bit too in ulogd instead of 32bit. Worked fine on little endian systems but big endian systems had zero counter... Didn't test ipfix output, but RFC allows template with either 32 or 64 counters, so should be safe. Signed-off-by: Ulrich Weber Signed-off-by: Eric Leblond --- util/printflow.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'util') diff --git a/util/printflow.c b/util/printflow.c index 30e622c..7702063 100644 --- a/util/printflow.c +++ b/util/printflow.c @@ -73,12 +73,12 @@ struct ulogd_key printflow_keys[FLOW_IDS] = { .name = "orig.l4.dport", }, { - .type = ULOGD_RET_UINT32, + .type = ULOGD_RET_UINT64, .flags = ULOGD_RETF_NONE, .name = "orig.raw.pktlen", }, { - .type = ULOGD_RET_UINT32, + .type = ULOGD_RET_UINT64, .flags = ULOGD_RETF_NONE, .name = "orig.raw.pktcount", }, @@ -108,12 +108,12 @@ struct ulogd_key printflow_keys[FLOW_IDS] = { .name = "reply.l4.dport", }, { - .type = ULOGD_RET_UINT32, + .type = ULOGD_RET_UINT64, .flags = ULOGD_RETF_NONE, .name = "reply.raw.pktlen", }, { - .type = ULOGD_RET_UINT32, + .type = ULOGD_RET_UINT64, .flags = ULOGD_RETF_NONE, .name = "reply.raw.pktcount", }, @@ -205,8 +205,8 @@ int printflow_print(struct ulogd_key *res, char *buf) } orig_out: - pp_print(buf_cur, "PKTS", res, PRINTFLOW_ORIG_RAW_PKTCOUNT, u32); - pp_print(buf_cur, "BYTES", res, PRINTFLOW_ORIG_RAW_PKTLEN, u32); + pp_print(buf_cur, "PKTS", res, PRINTFLOW_ORIG_RAW_PKTCOUNT, u64); + pp_print(buf_cur, "BYTES", res, PRINTFLOW_ORIG_RAW_PKTLEN, u64); buf_cur += sprintf(buf_cur, ", REPLY: "); @@ -256,8 +256,8 @@ orig_out: } reply_out: - pp_print(buf_cur, "PKTS", res, PRINTFLOW_REPLY_RAW_PKTCOUNT, u32); - pp_print(buf_cur, "BYTES", res, PRINTFLOW_REPLY_RAW_PKTLEN, u32); + pp_print(buf_cur, "PKTS", res, PRINTFLOW_REPLY_RAW_PKTCOUNT, u64); + pp_print(buf_cur, "BYTES", res, PRINTFLOW_REPLY_RAW_PKTLEN, u64); strcat(buf_cur, "\n"); return 0; -- cgit v1.2.3