]> err.no Git - linux-2.6/blobdiff - net/netfilter/xt_connmark.c
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
[linux-2.6] / net / netfilter / xt_connmark.c
index e810600345e3a59fce7b02cc8d6a847c123fb06c..dc26a27cbcafc2df58bad0ca5687a71d0aa29edf 100644 (file)
@@ -64,14 +64,30 @@ checkentry(const char *tablename,
                printk(KERN_WARNING "connmark: only support 32bit mark\n");
                return 0;
        }
+#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
+       if (nf_ct_l3proto_try_module_get(match->family) < 0) {
+               printk(KERN_WARNING "can't load nf_conntrack support for "
+                                   "proto=%d\n", match->family);
+               return 0;
+       }
+#endif
        return 1;
 }
 
+static void
+destroy(const struct xt_match *match, void *matchinfo, unsigned int matchsize)
+{
+#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
+       nf_ct_l3proto_module_put(match->family);
+#endif
+}
+
 static struct xt_match connmark_match = {
        .name           = "connmark",
        .match          = match,
        .matchsize      = sizeof(struct xt_connmark_info),
        .checkentry     = checkentry,
+       .destroy        = destroy,
        .family         = AF_INET,
        .me             = THIS_MODULE
 };
@@ -81,11 +97,12 @@ static struct xt_match connmark6_match = {
        .match          = match,
        .matchsize      = sizeof(struct xt_connmark_info),
        .checkentry     = checkentry,
+       .destroy        = destroy,
        .family         = AF_INET6,
        .me             = THIS_MODULE
 };
 
-static int __init init(void)
+static int __init xt_connmark_init(void)
 {
        int ret;
 
@@ -101,11 +118,11 @@ static int __init init(void)
        return ret;
 }
 
-static void __exit fini(void)
+static void __exit xt_connmark_fini(void)
 {
        xt_unregister_match(&connmark6_match);
        xt_unregister_match(&connmark_match);
 }
 
-module_init(init);
-module_exit(fini);
+module_init(xt_connmark_init);
+module_exit(xt_connmark_fini);