netfilter: nf_conntrack: don't try to deliver events for untracked connections
authorPatrick McHardy <kaber@trash.net>
Wed, 18 Feb 2009 14:30:34 +0000 (15:30 +0100)
committerPatrick McHardy <kaber@trash.net>
Wed, 18 Feb 2009 14:30:34 +0000 (15:30 +0100)
The untracked conntrack actually does usually have events marked for
delivery as its not special-cased in that part of the code. Skip the
actual delivery since it impacts performance noticeably.

Signed-off-by: Patrick McHardy <kaber@trash.net>
include/net/netfilter/nf_conntrack_core.h

index e78afe7..c25068e 100644 (file)
@@ -59,7 +59,7 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb)
        struct nf_conn *ct = (struct nf_conn *)skb->nfct;
        int ret = NF_ACCEPT;
 
-       if (ct) {
+       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);