Skip to contentSkip to conversation

netfilter: conntrack: increase drop stats if sequence adjustment fails

PATCH Applied Pablo Neira Ayuso 2 participants 2 messages Mar 4, 2009 – Mar 16, 2009

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 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().

---

 net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +3 -1
index 4273aa7..e06fd8a 100644
@@ -120,8 +120,10 @@ static unsigned int ipv4_confirm(unsigned int hooknum,
 		typeof(nf_nat_seq_adjust_hook) seq_adjust;
 
 		seq_adjust = rcu_dereference(nf_nat_seq_adjust_hook);
-		if (!seq_adjust || !seq_adjust(skb, ct, ctinfo))
+		if (!seq_adjust || !seq_adjust(skb, ct, ctinfo)) {
+			NF_CT_STAT_INC_ATOMIC(nf_ct_net(ct), drop);
 			return NF_DROP;
+		}
 	}
 out:
 	/* We've seen it coming out the other side: confirm it */
#1 lore raw
Quoted 2 lines · Pablo Neira Ayuso

This patch increases the statistics of packets drop if the sequence adjustment fails in ipv4_confirm().

Applied, thanks.