mac80211: fix vlan and optimise RX
[safe/jmp/linux-2.6] / net / netfilter / xt_connbytes.c
index 30c19b5..955e659 100644 (file)
@@ -92,12 +92,9 @@ connbytes_mt(const struct sk_buff *skb, const struct xt_match_param *par)
                return what >= sinfo->count.from;
 }
 
-static bool
-connbytes_mt_check(const char *tablename, const void *ip,
-                   const struct xt_match *match, void *matchinfo,
-                   unsigned int hook_mask)
+static bool connbytes_mt_check(const struct xt_mtchk_param *par)
 {
-       const struct xt_connbytes_info *sinfo = matchinfo;
+       const struct xt_connbytes_info *sinfo = par->matchinfo;
 
        if (sinfo->what != XT_CONNBYTES_PKTS &&
            sinfo->what != XT_CONNBYTES_BYTES &&
@@ -109,51 +106,39 @@ connbytes_mt_check(const char *tablename, const void *ip,
            sinfo->direction != XT_CONNBYTES_DIR_BOTH)
                return false;
 
-       if (nf_ct_l3proto_try_module_get(match->family) < 0) {
+       if (nf_ct_l3proto_try_module_get(par->family) < 0) {
                printk(KERN_WARNING "can't load conntrack support for "
-                                   "proto=%u\n", match->family);
+                                   "proto=%u\n", par->family);
                return false;
        }
 
        return true;
 }
 
-static void
-connbytes_mt_destroy(const struct xt_match *match, void *matchinfo)
+static void connbytes_mt_destroy(const struct xt_mtdtor_param *par)
 {
-       nf_ct_l3proto_module_put(match->family);
+       nf_ct_l3proto_module_put(par->family);
 }
 
-static struct xt_match connbytes_mt_reg[] __read_mostly = {
-       {
-               .name           = "connbytes",
-               .family         = NFPROTO_IPV4,
-               .checkentry     = connbytes_mt_check,
-               .match          = connbytes_mt,
-               .destroy        = connbytes_mt_destroy,
-               .matchsize      = sizeof(struct xt_connbytes_info),
-               .me             = THIS_MODULE
-       },
-       {
-               .name           = "connbytes",
-               .family         = NFPROTO_IPV6,
-               .checkentry     = connbytes_mt_check,
-               .match          = connbytes_mt,
-               .destroy        = connbytes_mt_destroy,
-               .matchsize      = sizeof(struct xt_connbytes_info),
-               .me             = THIS_MODULE
-       },
+static struct xt_match connbytes_mt_reg __read_mostly = {
+       .name       = "connbytes",
+       .revision   = 0,
+       .family     = NFPROTO_UNSPEC,
+       .checkentry = connbytes_mt_check,
+       .match      = connbytes_mt,
+       .destroy    = connbytes_mt_destroy,
+       .matchsize  = sizeof(struct xt_connbytes_info),
+       .me         = THIS_MODULE,
 };
 
 static int __init connbytes_mt_init(void)
 {
-       return xt_register_matches(connbytes_mt_reg,
-              ARRAY_SIZE(connbytes_mt_reg));
+       return xt_register_match(&connbytes_mt_reg);
 }
 
 static void __exit connbytes_mt_exit(void)
 {
-       xt_unregister_matches(connbytes_mt_reg, ARRAY_SIZE(connbytes_mt_reg));
+       xt_unregister_match(&connbytes_mt_reg);
 }
 
 module_init(connbytes_mt_init);