mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 23:24:50 +00:00
netfilter: conntrack: don't increment invalid counter on NF_REPEAT
The packet isn't invalid, REPEAT means we're trying again after cleaning
out a stale connection, e.g. via tcp tracker.
This caused increases of invalid stat counter in a test case involving
frequent connection reuse, even though no packet is actually invalid.
Fixes: 56a62e2218
("netfilter: conntrack: fix NF_REPEAT handling")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
7d70984a1a
commit
830af2eba4
1 changed files with 5 additions and 3 deletions
|
@ -1924,15 +1924,17 @@ nf_conntrack_in(struct sk_buff *skb, const struct nf_hook_state *state)
|
|||
pr_debug("nf_conntrack_in: Can't track with proto module\n");
|
||||
nf_ct_put(ct);
|
||||
skb->_nfct = 0;
|
||||
NF_CT_STAT_INC_ATOMIC(state->net, invalid);
|
||||
if (ret == -NF_DROP)
|
||||
NF_CT_STAT_INC_ATOMIC(state->net, drop);
|
||||
/* Special case: TCP tracker reports an attempt to reopen a
|
||||
* closed/aborted connection. We have to go back and create a
|
||||
* fresh conntrack.
|
||||
*/
|
||||
if (ret == -NF_REPEAT)
|
||||
goto repeat;
|
||||
|
||||
NF_CT_STAT_INC_ATOMIC(state->net, invalid);
|
||||
if (ret == -NF_DROP)
|
||||
NF_CT_STAT_INC_ATOMIC(state->net, drop);
|
||||
|
||||
ret = -ret;
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue