[NETFILTER]: nf_queue: remove unnecessary hook existance check
authorPatrick McHardy <kaber@trash.net>
Wed, 5 Dec 2007 09:23:41 +0000 (01:23 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:56:08 +0000 (14:56 -0800)
We hold a module reference for each queued packet, so the hook that
queued the packet can't disappear. Also remove an obsolete  comment
stating the opposite.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/core.c
net/netfilter/nf_queue.c

index e6d3a69b9e9b29614eb3d7c1a1042a558ce582bc..6819a4113e1ed094d2b693dde7afc4ac033ed887 100644 (file)
@@ -51,11 +51,6 @@ void nf_unregister_afinfo(struct nf_afinfo *afinfo)
 }
 EXPORT_SYMBOL_GPL(nf_unregister_afinfo);
 
-/* In this code, we can be waiting indefinitely for userspace to
- * service a packet if a hook returns NF_QUEUE.  We could keep a count
- * of skbuffs queued for userspace, and not deregister a hook unless
- * this is zero, but that sucks.  Now, we simply check when the
- * packets come back: if the hook is gone, the packet is discarded. */
 struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS] __read_mostly;
 EXPORT_SYMBOL(nf_hooks);
 static DEFINE_MUTEX(nf_hook_mutex);
index 81d010a05b986dd50a230e7d7e67e0ee3e156df4..0bea88c30e519b94965728877c2438eabf35554b 100644 (file)
@@ -223,7 +223,6 @@ void nf_reinject(struct sk_buff *skb, struct nf_info *info,
                 unsigned int verdict)
 {
        struct list_head *elem = &info->elem->list;
-       struct list_head *i;
        struct nf_afinfo *afinfo;
 
        rcu_read_lock();
@@ -245,18 +244,6 @@ void nf_reinject(struct sk_buff *skb, struct nf_info *info,
        /* Drop reference to owner of hook which queued us. */
        module_put(info->elem->owner);
 
-       list_for_each_rcu(i, &nf_hooks[info->pf][info->hook]) {
-               if (i == elem)
-                       break;
-       }
-
-       if (i == &nf_hooks[info->pf][info->hook]) {
-               /* The module which sent it to userspace is gone. */
-               NFDEBUG("%s: module disappeared, dropping packet.\n",
-                       __FUNCTION__);
-               verdict = NF_DROP;
-       }
-
        /* Continue traversal iff userspace said ok... */
        if (verdict == NF_REPEAT) {
                elem = elem->prev;
This page took 0.043026 seconds and 5 git commands to generate.