linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / net / netfilter / xt_connbytes.c
index 1396fe2..150d2a4 100644 (file)
@@ -44,7 +44,6 @@ static int
 match(const struct sk_buff *skb,
       const struct net_device *in,
       const struct net_device *out,
-      const struct xt_match *match,
       const void *matchinfo,
       int offset,
       unsigned int protoff,
@@ -123,13 +122,15 @@ match(const struct sk_buff *skb,
 
 static int check(const char *tablename,
                 const void *ip,
-                const struct xt_match *match,
                 void *matchinfo,
                 unsigned int matchsize,
                 unsigned int hook_mask)
 {
        const struct xt_connbytes_info *sinfo = matchinfo;
 
+       if (matchsize != XT_ALIGN(sizeof(struct xt_connbytes_info)))
+               return 0;
+
        if (sinfo->what != XT_CONNBYTES_PKTS &&
            sinfo->what != XT_CONNBYTES_BYTES &&
            sinfo->what != XT_CONNBYTES_AVGPKT)
@@ -145,39 +146,35 @@ static int check(const char *tablename,
 
 static struct xt_match connbytes_match = {
        .name           = "connbytes",
-       .match          = match,
-       .checkentry     = check,
-       .matchsize      = sizeof(struct xt_connbytes_info),
-       .family         = AF_INET,
+       .match          = &match,
+       .checkentry     = &check,
        .me             = THIS_MODULE
 };
 static struct xt_match connbytes6_match = {
        .name           = "connbytes",
-       .match          = match,
-       .checkentry     = check,
-       .matchsize      = sizeof(struct xt_connbytes_info),
-       .family         = AF_INET6,
+       .match          = &match,
+       .checkentry     = &check,
        .me             = THIS_MODULE
 };
 
-static int __init xt_connbytes_init(void)
+static int __init init(void)
 {
        int ret;
-       ret = xt_register_match(&connbytes_match);
+       ret = xt_register_match(AF_INET, &connbytes_match);
        if (ret)
                return ret;
 
-       ret = xt_register_match(&connbytes6_match);
+       ret = xt_register_match(AF_INET6, &connbytes6_match);
        if (ret)
-               xt_unregister_match(&connbytes_match);
+               xt_unregister_match(AF_INET, &connbytes_match);
        return ret;
 }
 
-static void __exit xt_connbytes_fini(void)
+static void __exit fini(void)
 {
-       xt_unregister_match(&connbytes_match);
-       xt_unregister_match(&connbytes6_match);
+       xt_unregister_match(AF_INET, &connbytes_match);
+       xt_unregister_match(AF_INET6, &connbytes6_match);
 }
 
-module_init(xt_connbytes_init);
-module_exit(xt_connbytes_fini);
+module_init(init);
+module_exit(fini);