Skip to content

Commit 1db7a74

Browse files
ummakyneskaber
authored andcommitted
netfilter: conntrack: increase drop stats if sequence adjustment fails
This patch increases the statistics of packets drop if the sequence adjustment fails in ipv4_confirm(). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Patrick McHardy <kaber@trash.net>
1 parent 67c0d57 commit 1db7a74

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ static unsigned int ipv4_confirm(unsigned int hooknum,
120120
typeof(nf_nat_seq_adjust_hook) seq_adjust;
121121

122122
seq_adjust = rcu_dereference(nf_nat_seq_adjust_hook);
123-
if (!seq_adjust || !seq_adjust(skb, ct, ctinfo))
123+
if (!seq_adjust || !seq_adjust(skb, ct, ctinfo)) {
124+
NF_CT_STAT_INC_ATOMIC(nf_ct_net(ct), drop);
124125
return NF_DROP;
126+
}
125127
}
126128
out:
127129
/* We've seen it coming out the other side: confirm it */

0 commit comments

Comments
 (0)