mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
netfilter: conntrack: don't increment invalid counter on NF_REPEAT
[ Upstream commit830af2eba4] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
129c71829d
commit
1af995c98b
@@ -1832,15 +1832,17 @@ repeat:
|
|||||||
pr_debug("nf_conntrack_in: Can't track with proto module\n");
|
pr_debug("nf_conntrack_in: Can't track with proto module\n");
|
||||||
nf_conntrack_put(&ct->ct_general);
|
nf_conntrack_put(&ct->ct_general);
|
||||||
skb->_nfct = 0;
|
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
|
/* Special case: TCP tracker reports an attempt to reopen a
|
||||||
* closed/aborted connection. We have to go back and create a
|
* closed/aborted connection. We have to go back and create a
|
||||||
* fresh conntrack.
|
* fresh conntrack.
|
||||||
*/
|
*/
|
||||||
if (ret == -NF_REPEAT)
|
if (ret == -NF_REPEAT)
|
||||||
goto 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;
|
ret = -ret;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user