[NETFILTER]: x_tables: remove unused size argument to check/destroy functions
[pandora-kernel.git] / net / ipv6 / netfilter / ip6_tables.c
index 0a67303..d1c3153 100644 (file)
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/in.h>
 #include <linux/skbuff.h>
 #include <linux/kmod.h>
 #include <linux/vmalloc.h>
 #include <linux/netdevice.h>
 #include <linux/module.h>
+#include <linux/poison.h>
 #include <linux/icmpv6.h>
 #include <net/ipv6.h>
 #include <asm/uaccess.h>
@@ -220,8 +220,7 @@ ip6t_error(struct sk_buff **pskb,
          const struct net_device *out,
          unsigned int hooknum,
          const struct xt_target *target,
-         const void *targinfo,
-         void *userinfo)
+         const void *targinfo)
 {
        if (net_ratelimit())
                printk("ip6_tables: error: `%s'\n", (char *)targinfo);
@@ -258,8 +257,7 @@ ip6t_do_table(struct sk_buff **pskb,
              unsigned int hook,
              const struct net_device *in,
              const struct net_device *out,
-             struct xt_table *table,
-             void *userdata)
+             struct xt_table *table)
 {
        static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long))));
        int offset = 0;
@@ -349,8 +347,7 @@ ip6t_do_table(struct sk_buff **pskb,
                                                                     in, out,
                                                                     hook,
                                                                     t->u.kernel.target,
-                                                                    t->data,
-                                                                    userdata);
+                                                                    t->data);
 
 #ifdef CONFIG_NETFILTER_DEBUG
                                if (((struct ip6t_entry *)table_base)->comefrom
@@ -377,7 +374,7 @@ ip6t_do_table(struct sk_buff **pskb,
        } while (!hotdrop);
 
 #ifdef CONFIG_NETFILTER_DEBUG
-       ((struct ip6t_entry *)table_base)->comefrom = 0xdead57ac;
+       ((struct ip6t_entry *)table_base)->comefrom = NETFILTER_LINK_POISON;
 #endif
        read_unlock_bh(&table->lock);
 
@@ -507,8 +504,7 @@ cleanup_match(struct ip6t_entry_match *m, unsigned int *i)
                return 1;
 
        if (m->u.kernel.match->destroy)
-               m->u.kernel.match->destroy(m->u.kernel.match, m->data,
-                                          m->u.match_size - sizeof(*m));
+               m->u.kernel.match->destroy(m->u.kernel.match, m->data);
        module_put(m->u.kernel.match->me);
        return 0;
 }
@@ -561,7 +557,6 @@ check_match(struct ip6t_entry_match *m,
 
        if (m->u.kernel.match->checkentry
            && !m->u.kernel.match->checkentry(name, ipv6, match,  m->data,
-                                             m->u.match_size - sizeof(*m),
                                              hookmask)) {
                duprintf("ip_tables: check failed for `%s'.\n",
                         m->u.kernel.match->name);
@@ -622,8 +617,6 @@ check_entry(struct ip6t_entry *e, const char *name, unsigned int size,
                }
        } else if (t->u.kernel.target->checkentry
                   && !t->u.kernel.target->checkentry(name, e, target, t->data,
-                                                     t->u.target_size
-                                                     - sizeof(*t),
                                                      e->comefrom)) {
                duprintf("ip_tables: check failed for `%s'.\n",
                         t->u.kernel.target->name);
@@ -695,8 +688,7 @@ cleanup_entry(struct ip6t_entry *e, unsigned int *i)
        IP6T_MATCH_ITERATE(e, cleanup_match, NULL);
        t = ip6t_get_target(e);
        if (t->u.kernel.target->destroy)
-               t->u.kernel.target->destroy(t->u.kernel.target, t->data,
-                                           t->u.target_size - sizeof(*t));
+               t->u.kernel.target->destroy(t->u.kernel.target, t->data);
        module_put(t->u.kernel.target->me);
        return 0;
 }
@@ -1103,7 +1095,7 @@ do_add_counters(void __user *user, unsigned int len)
 
        write_lock_bh(&t->lock);
        private = t->private;
-       if (private->number != paddc->num_counters) {
+       if (private->number != tmp.num_counters) {
                ret = -EINVAL;
                goto unlock_up_free;
        }
@@ -1281,7 +1273,8 @@ int ip6t_register_table(struct xt_table *table,
                return ret;
        }
 
-       if (xt_register_table(table, &bootstrap, newinfo) != 0) {
+       ret = xt_register_table(table, &bootstrap, newinfo);
+       if (ret != 0) {
                xt_free_table_info(newinfo);
                return ret;
        }
@@ -1351,7 +1344,6 @@ icmp6_checkentry(const char *tablename,
           const void *entry,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchsize,
           unsigned int hook_mask)
 {
        const struct ip6t_icmp *icmpinfo = matchinfo;
@@ -1397,23 +1389,39 @@ static int __init ip6_tables_init(void)
 {
        int ret;
 
-       xt_proto_init(AF_INET6);
+       ret = xt_proto_init(AF_INET6);
+       if (ret < 0)
+               goto err1;
 
        /* Noone else will be downing sem now, so we won't sleep */
-       xt_register_target(&ip6t_standard_target);
-       xt_register_target(&ip6t_error_target);
-       xt_register_match(&icmp6_matchstruct);
+       ret = xt_register_target(&ip6t_standard_target);
+       if (ret < 0)
+               goto err2;
+       ret = xt_register_target(&ip6t_error_target);
+       if (ret < 0)
+               goto err3;
+       ret = xt_register_match(&icmp6_matchstruct);
+       if (ret < 0)
+               goto err4;
 
        /* Register setsockopt */
        ret = nf_register_sockopt(&ip6t_sockopts);
-       if (ret < 0) {
-               duprintf("Unable to register sockopts.\n");
-               xt_proto_fini(AF_INET6);
-               return ret;
-       }
+       if (ret < 0)
+               goto err5;
 
        printk("ip6_tables: (C) 2000-2006 Netfilter Core Team\n");
        return 0;
+
+err5:
+       xt_unregister_match(&icmp6_matchstruct);
+err4:
+       xt_unregister_target(&ip6t_error_target);
+err3:
+       xt_unregister_target(&ip6t_standard_target);
+err2:
+       xt_proto_fini(AF_INET6);
+err1:
+       return ret;
 }
 
 static void __exit ip6_tables_fini(void)