]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netfilter/xt_physdev.c
[SCSI] fix netlink kernel-doc
[linux-2.6-omap-h63xx.git] / net / netfilter / xt_physdev.c
index 4ec1094bda929771fbe13e403f3fcb98e0fa2b8e..1bcdfc12cf59827028c682d898ea15f45df3e6a6 100644 (file)
@@ -21,14 +21,11 @@ MODULE_ALIAS("ipt_physdev");
 MODULE_ALIAS("ip6t_physdev");
 
 static bool
-physdev_mt(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)
+physdev_mt(const struct sk_buff *skb, const struct xt_match_param *par)
 {
        int i;
        static const char nulldevname[IFNAMSIZ];
-       const struct xt_physdev_info *info = matchinfo;
+       const struct xt_physdev_info *info = par->matchinfo;
        bool ret;
        const char *indev, *outdev;
        const struct nf_bridge_info *nf_bridge;
@@ -94,12 +91,9 @@ match_outdev:
        return ret ^ !(info->invert & XT_PHYSDEV_OP_OUT);
 }
 
-static bool
-physdev_mt_check(const char *tablename, const void *ip,
-                 const struct xt_match *match, void *matchinfo,
-                 unsigned int hook_mask)
+static bool physdev_mt_check(const struct xt_mtchk_param *par)
 {
-       const struct xt_physdev_info *info = matchinfo;
+       const struct xt_physdev_info *info = par->matchinfo;
 
        if (!(info->bitmask & XT_PHYSDEV_OP_MASK) ||
            info->bitmask & ~XT_PHYSDEV_OP_MASK)
@@ -107,44 +101,35 @@ physdev_mt_check(const char *tablename, const void *ip,
        if (info->bitmask & XT_PHYSDEV_OP_OUT &&
            (!(info->bitmask & XT_PHYSDEV_OP_BRIDGED) ||
             info->invert & XT_PHYSDEV_OP_BRIDGED) &&
-           hook_mask & ((1 << NF_INET_LOCAL_OUT) | (1 << NF_INET_FORWARD) |
-                        (1 << NF_INET_POST_ROUTING))) {
+           par->hook_mask & ((1 << NF_INET_LOCAL_OUT) |
+           (1 << NF_INET_FORWARD) | (1 << NF_INET_POST_ROUTING))) {
                printk(KERN_WARNING "physdev match: using --physdev-out in the "
                       "OUTPUT, FORWARD and POSTROUTING chains for non-bridged "
                       "traffic is not supported anymore.\n");
-               if (hook_mask & (1 << NF_INET_LOCAL_OUT))
+               if (par->hook_mask & (1 << NF_INET_LOCAL_OUT))
                        return false;
        }
        return true;
 }
 
-static struct xt_match physdev_mt_reg[] __read_mostly = {
-       {
-               .name           = "physdev",
-               .family         = AF_INET,
-               .checkentry     = physdev_mt_check,
-               .match          = physdev_mt,
-               .matchsize      = sizeof(struct xt_physdev_info),
-               .me             = THIS_MODULE,
-       },
-       {
-               .name           = "physdev",
-               .family         = AF_INET6,
-               .checkentry     = physdev_mt_check,
-               .match          = physdev_mt,
-               .matchsize      = sizeof(struct xt_physdev_info),
-               .me             = THIS_MODULE,
-       },
+static struct xt_match physdev_mt_reg __read_mostly = {
+       .name       = "physdev",
+       .revision   = 0,
+       .family     = NFPROTO_UNSPEC,
+       .checkentry = physdev_mt_check,
+       .match      = physdev_mt,
+       .matchsize  = sizeof(struct xt_physdev_info),
+       .me         = THIS_MODULE,
 };
 
 static int __init physdev_mt_init(void)
 {
-       return xt_register_matches(physdev_mt_reg, ARRAY_SIZE(physdev_mt_reg));
+       return xt_register_match(&physdev_mt_reg);
 }
 
 static void __exit physdev_mt_exit(void)
 {
-       xt_unregister_matches(physdev_mt_reg, ARRAY_SIZE(physdev_mt_reg));
+       xt_unregister_match(&physdev_mt_reg);
 }
 
 module_init(physdev_mt_init);