]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netfilter/nf_conntrack_helper.c
Merge branch 'for-2.6.27' of git://linux-nfs.org/~bfields/linux
[linux-2.6-omap-h63xx.git] / net / netfilter / nf_conntrack_helper.c
index 42f781fcba649bbe783523d2a1d547296fb379e8..8e0b4c8f62a8da1156d72c5e96b8c6f9e1c42e29 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/err.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
+#include <linux/rculist.h>
 
 #include <net/netfilter/nf_conntrack.h>
 #include <net/netfilter/nf_conntrack_l3proto.h>
@@ -110,7 +111,8 @@ int nf_conntrack_helper_register(struct nf_conntrack_helper *me)
 {
        unsigned int h = helper_hash(&me->tuple);
 
-       BUG_ON(me->timeout == 0);
+       BUG_ON(me->expect_policy == NULL);
+       BUG_ON(me->expect_class_max >= NF_CT_MAX_EXPECT_CLASSES);
 
        mutex_lock(&nf_ct_helper_mutex);
        hlist_add_head_rcu(&me->hnode, &nf_ct_helper_hash[h]);
@@ -125,7 +127,7 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
 {
        struct nf_conntrack_tuple_hash *h;
        struct nf_conntrack_expect *exp;
-       struct hlist_node *n, *next;
+       const struct hlist_node *n, *next;
        unsigned int i;
 
        mutex_lock(&nf_ct_helper_mutex);
@@ -138,7 +140,7 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
         */
        synchronize_rcu();
 
-       write_lock_bh(&nf_conntrack_lock);
+       spin_lock_bh(&nf_conntrack_lock);
 
        /* Get rid of expectations */
        for (i = 0; i < nf_ct_expect_hsize; i++) {
@@ -160,7 +162,7 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
                hlist_for_each_entry(h, n, &nf_conntrack_hash[i], hnode)
                        unhelp(h, me);
        }
-       write_unlock_bh(&nf_conntrack_lock);
+       spin_unlock_bh(&nf_conntrack_lock);
 }
 EXPORT_SYMBOL_GPL(nf_conntrack_helper_unregister);