]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/netfilter/nf_conntrack_helper.c
V4L/DVB (5127): M920x: update megasky driver for recent changes in the dvb tree
[karo-tx-linux.git] / net / netfilter / nf_conntrack_helper.c
index ca044875a561ae66deb9e94e89d9d9a8382fdf0c..0743be4434b019d201a0caa4dc5826d7061d4f75 100644 (file)
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 
-#define ASSERT_READ_LOCK(x)
-#define ASSERT_WRITE_LOCK(x)
-
 #include <net/netfilter/nf_conntrack.h>
 #include <net/netfilter/nf_conntrack_l3proto.h>
-#include <net/netfilter/nf_conntrack_protocol.h>
+#include <net/netfilter/nf_conntrack_l4proto.h>
 #include <net/netfilter/nf_conntrack_helper.h>
 #include <net/netfilter/nf_conntrack_core.h>
 
-static LIST_HEAD(helpers);
+static __read_mostly LIST_HEAD(helpers);
 
 struct nf_conntrack_helper *
 __nf_ct_helper_find(const struct nf_conntrack_tuple *tuple)
@@ -66,11 +63,13 @@ nf_ct_helper_find_get( const struct nf_conntrack_tuple *tuple)
 
        return helper;
 }
+EXPORT_SYMBOL_GPL(nf_ct_helper_find_get);
 
 void nf_ct_helper_put(struct nf_conntrack_helper *helper)
 {
        module_put(helper->me);
 }
+EXPORT_SYMBOL_GPL(nf_ct_helper_put);
 
 struct nf_conntrack_helper *
 __nf_conntrack_helper_find_byname(const char *name)
@@ -84,6 +83,7 @@ __nf_conntrack_helper_find_byname(const char *name)
 
        return NULL;
 }
+EXPORT_SYMBOL_GPL(__nf_conntrack_helper_find_byname);
 
 static inline int unhelp(struct nf_conntrack_tuple_hash *i,
                         const struct nf_conntrack_helper *me)
@@ -100,13 +100,14 @@ static inline int unhelp(struct nf_conntrack_tuple_hash *i,
 
 int nf_conntrack_helper_register(struct nf_conntrack_helper *me)
 {
-       int ret;
+       int size, ret;
+
        BUG_ON(me->timeout == 0);
 
+       size = ALIGN(sizeof(struct nf_conn), __alignof__(struct nf_conn_help)) +
+              sizeof(struct nf_conn_help);
        ret = nf_conntrack_register_cache(NF_CT_F_HELP, "nf_conntrack:help",
-                                         sizeof(struct nf_conn)
-                                         + sizeof(struct nf_conn_help)
-                                         + __alignof__(struct nf_conn_help));
+                                         size);
        if (ret < 0) {
                printk(KERN_ERR "nf_conntrack_helper_register: Unable to create slab cache for conntracks\n");
                return ret;
@@ -117,6 +118,7 @@ int nf_conntrack_helper_register(struct nf_conntrack_helper *me)
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(nf_conntrack_helper_register);
 
 void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
 {
@@ -131,7 +133,8 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
        /* Get rid of expectations */
        list_for_each_entry_safe(exp, tmp, &nf_conntrack_expect_list, list) {
                struct nf_conn_help *help = nfct_help(exp->master);
-               if (help->helper == me && del_timer(&exp->timeout)) {
+               if ((help->helper == me || exp->helper == me) &&
+                   del_timer(&exp->timeout)) {
                        nf_ct_unlink_expect(exp);
                        nf_conntrack_expect_put(exp);
                }
@@ -149,3 +152,4 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
        /* Someone could be still looking at the helper in a bh. */
        synchronize_net();
 }
+EXPORT_SYMBOL_GPL(nf_conntrack_helper_unregister);