linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / net / ipv4 / netfilter / ipt_iprange.c
index 5202edd..13fb16f 100644 (file)
@@ -27,7 +27,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, int *hotdrop)
 {
@@ -63,23 +62,38 @@ match(const struct sk_buff *skb,
        return 1;
 }
 
-static struct ipt_match iprange_match = {
-       .name           = "iprange",
-       .match          = match,
-       .matchsize      = sizeof(struct ipt_iprange_info),
-       .destroy        = NULL,
-       .me             = THIS_MODULE
+static int check(const char *tablename,
+                const void *inf,
+                void *matchinfo,
+                unsigned int matchsize,
+                unsigned int hook_mask)
+{
+       /* verify size */
+       if (matchsize != IPT_ALIGN(sizeof(struct ipt_iprange_info)))
+               return 0;
+
+       return 1;
+}
+
+static struct ipt_match iprange_match = 
+{ 
+       .list = { NULL, NULL }, 
+       .name = "iprange", 
+       .match = &match, 
+       .checkentry = &check, 
+       .destroy = NULL, 
+       .me = THIS_MODULE
 };
 
-static int __init ipt_iprange_init(void)
+static int __init init(void)
 {
        return ipt_register_match(&iprange_match);
 }
 
-static void __exit ipt_iprange_fini(void)
+static void __exit fini(void)
 {
        ipt_unregister_match(&iprange_match);
 }
 
-module_init(ipt_iprange_init);
-module_exit(ipt_iprange_fini);
+module_init(init);
+module_exit(fini);