]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv6/netfilter/ip6t_ipv6header.c
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6-omap-h63xx.git] / net / ipv6 / netfilter / ip6t_ipv6header.c
index 2c65c2f9a4ab116ea3de849f810d554be10f57ad..14e6724d5672a7ff291ced4de556da7a7d920d29 100644 (file)
 #include <linux/netfilter_ipv6/ip6t_ipv6header.h>
 
 MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("IPv6 headers match");
+MODULE_DESCRIPTION("Xtables: IPv6 header types match");
 MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
 
 static bool
-ipv6header_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,
-                bool *hotdrop)
+ipv6header_mt6(const struct sk_buff *skb, const struct xt_match_param *par)
 {
-       const struct ip6t_ipv6header_info *info = matchinfo;
+       const struct ip6t_ipv6header_info *info = par->matchinfo;
        unsigned int temp;
        int len;
        u8 nexthdr;
@@ -53,7 +46,8 @@ ipv6header_match(const struct sk_buff *skb,
        temp = 0;
 
        while (ip6t_ext_hdr(nexthdr)) {
-               struct ipv6_opt_hdr _hdr, *hp;
+               const struct ipv6_opt_hdr *hp;
+               struct ipv6_opt_hdr _hdr;
                int hdrlen;
 
                /* Is there enough space for the next ext header? */
@@ -124,14 +118,9 @@ ipv6header_match(const struct sk_buff *skb,
        }
 }
 
-static bool
-ipv6header_checkentry(const char *tablename,
-                     const void *ip,
-                     const struct xt_match *match,
-                     void *matchinfo,
-                     unsigned int hook_mask)
+static bool ipv6header_mt6_check(const struct xt_mtchk_param *par)
 {
-       const struct ip6t_ipv6header_info *info = matchinfo;
+       const struct ip6t_ipv6header_info *info = par->matchinfo;
 
        /* invflags is 0 or 0xff in hard mode */
        if ((!info->modeflag) && info->invflags != 0x00 &&
@@ -141,25 +130,25 @@ ipv6header_checkentry(const char *tablename,
        return true;
 }
 
-static struct xt_match ip6t_ipv6header_match __read_mostly = {
+static struct xt_match ipv6header_mt6_reg __read_mostly = {
        .name           = "ipv6header",
-       .family         = AF_INET6,
-       .match          = &ipv6header_match,
+       .family         = NFPROTO_IPV6,
+       .match          = ipv6header_mt6,
        .matchsize      = sizeof(struct ip6t_ipv6header_info),
-       .checkentry     = &ipv6header_checkentry,
+       .checkentry     = ipv6header_mt6_check,
        .destroy        = NULL,
        .me             = THIS_MODULE,
 };
 
-static int __init ipv6header_init(void)
+static int __init ipv6header_mt6_init(void)
 {
-       return xt_register_match(&ip6t_ipv6header_match);
+       return xt_register_match(&ipv6header_mt6_reg);
 }
 
-static void __exit ipv6header_exit(void)
+static void __exit ipv6header_mt6_exit(void)
 {
-       xt_unregister_match(&ip6t_ipv6header_match);
+       xt_unregister_match(&ipv6header_mt6_reg);
 }
 
-module_init(ipv6header_init);
-module_exit(ipv6header_exit);
+module_init(ipv6header_mt6_init);
+module_exit(ipv6header_mt6_exit);