]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: conntrack: small refactoring of conntrack seq_printf
authorFlorian Westphal <fw@strlen.de>
Thu, 28 Apr 2016 17:13:44 +0000 (19:13 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 5 May 2016 14:39:45 +0000 (16:39 +0200)
commit5353f098eaac5b09e98d1f30b0f7a134f9881e34
tree73bf9cd8574a8c9067c377c32e35f3493f956dce
parent7685a51164f1d71dcc0c3455a9829b6cdc4bec69
netfilter: conntrack: small refactoring of conntrack seq_printf

The iteration process is lockless, so we test if the conntrack object is
eligible for printing (e.g. is AF_INET) after obtaining the reference
count.

Once we put all conntracks into same hash table we might see more
entries that need to be skipped.

So add a helper and first perform the test in a lockless fashion
for fast skip.

Once we obtain the reference count, just repeat the check.

Note that this refactoring also includes a missing check for unconfirmed
conntrack entries due to slab rcu object re-usage, so they need to be
skipped since they are not part of the listing.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c