linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / net / netfilter / xt_CONNMARK.c
index 60c375d..22506e3 100644 (file)
@@ -37,7 +37,6 @@ target(struct sk_buff **pskb,
        const struct net_device *in,
        const struct net_device *out,
        unsigned int hooknum,
-       const struct xt_target *target,
        const void *targinfo,
        void *userinfo)
 {
@@ -75,12 +74,17 @@ target(struct sk_buff **pskb,
 static int
 checkentry(const char *tablename,
           const void *entry,
-          const struct xt_target *target,
           void *targinfo,
           unsigned int targinfosize,
           unsigned int hook_mask)
 {
        struct xt_connmark_target_info *matchinfo = targinfo;
+       if (targinfosize != XT_ALIGN(sizeof(struct xt_connmark_target_info))) {
+               printk(KERN_WARNING "CONNMARK: targinfosize %u != %Zu\n",
+                      targinfosize,
+                      XT_ALIGN(sizeof(struct xt_connmark_target_info)));
+               return 0;
+       }
 
        if (matchinfo->mode == XT_CONNMARK_RESTORE) {
            if (strcmp(tablename, "mangle") != 0) {
@@ -98,45 +102,40 @@ checkentry(const char *tablename,
 }
 
 static struct xt_target connmark_reg = {
-       .name           = "CONNMARK",
-       .target         = target,
-       .targetsize     = sizeof(struct xt_connmark_target_info),
-       .checkentry     = checkentry,
-       .family         = AF_INET,
-       .me             = THIS_MODULE
+       .name = "CONNMARK",
+       .target = &target,
+       .checkentry = &checkentry,
+       .me = THIS_MODULE
 };
-
 static struct xt_target connmark6_reg = {
-       .name           = "CONNMARK",
-       .target         = target,
-       .targetsize     = sizeof(struct xt_connmark_target_info),
-       .checkentry     = checkentry,
-       .family         = AF_INET6,
-       .me             = THIS_MODULE
+       .name = "CONNMARK",
+       .target = &target,
+       .checkentry = &checkentry,
+       .me = THIS_MODULE
 };
 
-static int __init xt_connmark_init(void)
+static int __init init(void)
 {
        int ret;
 
        need_conntrack();
 
-       ret = xt_register_target(&connmark_reg);
+       ret = xt_register_target(AF_INET, &connmark_reg);
        if (ret)
                return ret;
 
-       ret = xt_register_target(&connmark6_reg);
+       ret = xt_register_target(AF_INET6, &connmark6_reg);
        if (ret)
-               xt_unregister_target(&connmark_reg);
+               xt_unregister_target(AF_INET, &connmark_reg);
 
        return ret;
 }
 
-static void __exit xt_connmark_fini(void)
+static void __exit fini(void)
 {
-       xt_unregister_target(&connmark_reg);
-       xt_unregister_target(&connmark6_reg);
+       xt_unregister_target(AF_INET, &connmark_reg);
+       xt_unregister_target(AF_INET6, &connmark6_reg);
 }
 
-module_init(xt_connmark_init);
-module_exit(xt_connmark_fini);
+module_init(init);
+module_exit(fini);