]> err.no Git - linux-2.6/blobdiff - net/netfilter/xt_comment.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild
[linux-2.6] / net / netfilter / xt_comment.c
index 4ba6fd65c6e9319a6be5b4eb321cd6a600e72f3b..2637724b498dc3f96ff4e21b838d789918f46f1e 100644 (file)
@@ -19,6 +19,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 protooff,
@@ -28,30 +29,19 @@ match(const struct sk_buff *skb,
        return 1;
 }
 
-static int
-checkentry(const char *tablename,
-           const void *ip,
-           void *matchinfo,
-           unsigned int matchsize,
-           unsigned int hook_mask)
-{
-       /* Check the size */
-       if (matchsize != XT_ALIGN(sizeof(struct xt_comment_info)))
-               return 0;
-       return 1;
-}
-
 static struct xt_match comment_match = {
        .name           = "comment",
        .match          = match,
-       .checkentry     = checkentry,
+       .matchsize      = sizeof(struct xt_comment_info),
+       .family         = AF_INET,
        .me             = THIS_MODULE
 };
 
 static struct xt_match comment6_match = {
        .name           = "comment",
        .match          = match,
-       .checkentry     = checkentry,
+       .matchsize      = sizeof(struct xt_comment_info),
+       .family         = AF_INET6,
        .me             = THIS_MODULE
 };
 
@@ -59,21 +49,21 @@ static int __init init(void)
 {
        int ret;
 
-       ret = xt_register_match(AF_INET, &comment_match);
+       ret = xt_register_match(&comment_match);
        if (ret)
                return ret;
 
-       ret = xt_register_match(AF_INET6, &comment6_match);
+       ret = xt_register_match(&comment6_match);
        if (ret)
-               xt_unregister_match(AF_INET, &comment_match);
+               xt_unregister_match(&comment_match);
 
        return ret;
 }
 
 static void __exit fini(void)
 {
-       xt_unregister_match(AF_INET, &comment_match);
-       xt_unregister_match(AF_INET6, &comment6_match);
+       xt_unregister_match(&comment_match);
+       xt_unregister_match(&comment6_match);
 }
 
 module_init(init);