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 --- input/flow/ulogd_inpflow_NFCT.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'input/flow') diff --git a/input/flow/ulogd_inpflow_NFCT.c b/input/flow/ulogd_inpflow_NFCT.c index afb6c18..ab2bc10 100644 --- a/input/flow/ulogd_inpflow_NFCT.c +++ b/input/flow/ulogd_inpflow_NFCT.c @@ -240,7 +240,7 @@ static struct ulogd_key nfct_okeys[] = { }, }, { - .type = ULOGD_RET_UINT32, + .type = ULOGD_RET_UINT64, .flags = ULOGD_RETF_NONE, .name = "orig.raw.pktlen", .ipfix = { @@ -250,7 +250,7 @@ static struct ulogd_key nfct_okeys[] = { }, }, { - .type = ULOGD_RET_UINT32, + .type = ULOGD_RET_UINT64, .flags = ULOGD_RETF_NONE, .name = "orig.raw.pktcount", .ipfix = { @@ -305,7 +305,7 @@ static struct ulogd_key nfct_okeys[] = { }, }, { - .type = ULOGD_RET_UINT32, + .type = ULOGD_RET_UINT64, .flags = ULOGD_RETF_NONE, .name = "reply.raw.pktlen", .ipfix = { @@ -315,7 +315,7 @@ static struct ulogd_key nfct_okeys[] = { }, }, { - .type = ULOGD_RET_UINT32, + .type = ULOGD_RET_UINT64, .flags = ULOGD_RETF_NONE, .name = "reply.raw.pktcount", .ipfix = { @@ -561,14 +561,14 @@ static int propagate_ct(struct ulogd_pluginstance *main_upi, htons(nfct_get_attr_u16(ct, ATTR_REPL_PORT_DST))); } - okey_set_u32(&ret[NFCT_ORIG_RAW_PKTLEN], - nfct_get_attr_u32(ct, ATTR_ORIG_COUNTER_BYTES)); - okey_set_u32(&ret[NFCT_ORIG_RAW_PKTCOUNT], - nfct_get_attr_u32(ct, ATTR_ORIG_COUNTER_PACKETS)); - okey_set_u32(&ret[NFCT_REPLY_RAW_PKTLEN], - nfct_get_attr_u32(ct, ATTR_REPL_COUNTER_BYTES)); - okey_set_u32(&ret[NFCT_REPLY_RAW_PKTCOUNT], - nfct_get_attr_u32(ct, ATTR_REPL_COUNTER_PACKETS)); + okey_set_u64(&ret[NFCT_ORIG_RAW_PKTLEN], + nfct_get_attr_u64(ct, ATTR_ORIG_COUNTER_BYTES)); + okey_set_u64(&ret[NFCT_ORIG_RAW_PKTCOUNT], + nfct_get_attr_u64(ct, ATTR_ORIG_COUNTER_PACKETS)); + okey_set_u64(&ret[NFCT_REPLY_RAW_PKTLEN], + nfct_get_attr_u64(ct, ATTR_REPL_COUNTER_BYTES)); + okey_set_u64(&ret[NFCT_REPLY_RAW_PKTCOUNT], + nfct_get_attr_u64(ct, ATTR_REPL_COUNTER_PACKETS)); okey_set_u32(&ret[NFCT_CT_MARK], nfct_get_attr_u32(ct, ATTR_MARK)); okey_set_u32(&ret[NFCT_CT_ID], nfct_get_attr_u32(ct, ATTR_ID)); -- cgit v1.2.3