All of lore.kernel.org
 help / color / mirror / Atom feed
From: "medialy" <medialy@gmail.com>
To: "netfilter-devel" <netfilter-devel@vger.kernel.org>
Subject: why counters in nf_conntrack not set in centos 6.x?
Date: Wed, 11 Dec 2013 23:05:01 +0800	[thread overview]
Message-ID: <52A87F08.5040509@gmail.com> (raw)


An application based on libnetfilter_conntrack and libnfnetlink failed to get counters in CentOS 6.x, 
but it works works fine with the same code in CentOS 5.x. How to enable the counter functionality?
Sample code:

handle_conntrack_ = nfct_open(CONNTRACK, NF_NETLINK_CONNTRACK_DESTROY);
nfct_callback_register(handle_conntrack_, NFCT_T_ALL, conntrack_callback, NULL);

static int conntrack_callback(enum nf_conntrack_msg_type type, struct nf_conntrack* ct, void* data)
{
    struct __nfct_counters orig_counter = ct->counters[__DIR_ORIG];
    struct __nfct_counters repl_counter = ct->counters[__DIR_REPL];
    //in CentOS 6.x, orig_counter.packets,orig_counter.bytes,repl_counter.packets and repl_counter.bytes are not set(zero)
}

OS and library version:
CentOS 6.4 x86_64
libnfnetlink-1.0.0
libnetfilter_conntrack-0.0.100

                 reply	other threads:[~2013-12-11 15:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52A87F08.5040509@gmail.com \
    --to=medialy@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.