Skip to contentSkip to conversation

netfilter: conntrack: don't deliver events for racy packets

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

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 netfilter: conntrack: don't deliver events for racy packets

This patch skips the delivery of conntrack events if the packet was drop due to a race condition in the conntrack insertion.

---

 include/net/netfilter/nf_conntrack_core.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/net/netfilter/nf_conntrack_core.h +2 -1
index c25068e..5a449b4 100644
@@ -62,7 +62,8 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb)
 	if (ct && ct != &nf_conntrack_untracked) {
 		if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct))
 			ret = __nf_conntrack_confirm(skb);
-		nf_ct_deliver_cached_events(ct);
+		if (likely(ret == NF_ACCEPT))
+			nf_ct_deliver_cached_events(ct);
 	}
 	return ret;
 }
#1 lore raw
Quoted 2 lines · Pablo Neira Ayuso

This patch skips the delivery of conntrack events if the packet was drop due to a race condition in the conntrack insertion.

Applied, thanks.