]> err.no Git - linux-2.6/blobdiff - net/netfilter/xt_length.c
[NETFILTER]: x_tables: replace IPv4/IPv6 policy match by address family independant...
[linux-2.6] / net / netfilter / xt_length.c
index ab6c710cf88f815df4c322955678f97eea521167..b9e60f041a64d19f5bf41bead3cccb95d86942cc 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <linux/module.h>
 #include <linux/skbuff.h>
+#include <linux/ipv6.h>
 #include <net/ip.h>
 
 #include <linux/netfilter/xt_length.h>
@@ -23,6 +24,7 @@ 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,
@@ -38,6 +40,7 @@ static int
 match6(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,
@@ -49,29 +52,17 @@ match6(const struct sk_buff *skb,
        return (pktlen >= info->min && pktlen <= info->max) ^ info->invert;
 }
 
-static int
-checkentry(const char *tablename,
-           const void *ip,
-           void *matchinfo,
-           unsigned int matchsize,
-           unsigned int hook_mask)
-{
-       if (matchsize != XT_ALIGN(sizeof(struct xt_length_info)))
-               return 0;
-
-       return 1;
-}
-
 static struct xt_match length_match = {
        .name           = "length",
-       .match          = &match,
-       .checkentry     = &checkentry,
+       .match          = match,
+       .matchsize      = sizeof(struct xt_length_info),
        .me             = THIS_MODULE,
 };
+
 static struct xt_match length6_match = {
        .name           = "length",
-       .match          = &match6,
-       .checkentry     = &checkentry,
+       .match          = match6,
+       .matchsize      = sizeof(struct xt_length_info),
        .me             = THIS_MODULE,
 };