]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv6/netfilter/ip6_tables.c
Merge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[linux-2.6-omap-h63xx.git] / net / ipv6 / netfilter / ip6_tables.c
index 9c843e3777bc8f11f37946159a0120632069cd1f..a33485dc81cb107e1cc343a764126325c9db2c05 100644 (file)
@@ -200,15 +200,11 @@ ip6_checkentry(const struct ip6t_ip6 *ipv6)
 }
 
 static unsigned int
-ip6t_error(struct sk_buff *skb,
-         const struct net_device *in,
-         const struct net_device *out,
-         unsigned int hooknum,
-         const struct xt_target *target,
-         const void *targinfo)
+ip6t_error(struct sk_buff *skb, const struct xt_target_param *par)
 {
        if (net_ratelimit())
-               printk("ip6_tables: error: `%s'\n", (char *)targinfo);
+               printk("ip6_tables: error: `%s'\n",
+                      (const char *)par->targinfo);
 
        return NF_DROP;
 }
@@ -360,6 +356,7 @@ ip6t_do_table(struct sk_buff *skb,
        struct ip6t_entry *e, *back;
        struct xt_table_info *private;
        struct xt_match_param mtpar;
+       struct xt_target_param tgpar;
 
        /* Initialization */
        indev = in ? in->name : nulldevname;
@@ -371,8 +368,10 @@ ip6t_do_table(struct sk_buff *skb,
         * rule is also a fragment-specific rule, non-fragments won't
         * match it. */
        mtpar.hotdrop = &hotdrop;
-       mtpar.in      = in;
-       mtpar.out     = out;
+       mtpar.in      = tgpar.in  = in;
+       mtpar.out     = tgpar.out = out;
+       mtpar.family  = tgpar.family = NFPROTO_IPV6;
+       tgpar.hooknum = hook;
 
        read_lock_bh(&table->lock);
        IP_NF_ASSERT(table->valid_hooks & (1 << hook));
@@ -438,15 +437,15 @@ ip6t_do_table(struct sk_buff *skb,
                        } else {
                                /* Targets which reenter must return
                                   abs. verdicts */
+                               tgpar.target   = t->u.kernel.target;
+                               tgpar.targinfo = t->data;
+
 #ifdef CONFIG_NETFILTER_DEBUG
                                ((struct ip6t_entry *)table_base)->comefrom
                                        = 0xeeeeeeec;
 #endif
                                verdict = t->u.kernel.target->target(skb,
-                                                                    in, out,
-                                                                    hook,
-                                                                    t->u.kernel.target,
-                                                                    t->data);
+                                                                    &tgpar);
 
 #ifdef CONFIG_NETFILTER_DEBUG
                                if (((struct ip6t_entry *)table_base)->comefrom
@@ -599,12 +598,17 @@ mark_source_chains(struct xt_table_info *newinfo,
 static int
 cleanup_match(struct ip6t_entry_match *m, unsigned int *i)
 {
+       struct xt_mtdtor_param par;
+
        if (i && (*i)-- == 0)
                return 1;
 
-       if (m->u.kernel.match->destroy)
-               m->u.kernel.match->destroy(m->u.kernel.match, m->data);
-       module_put(m->u.kernel.match->me);
+       par.match     = m->u.kernel.match;
+       par.matchinfo = m->data;
+       par.family    = NFPROTO_IPV6;
+       if (par.match->destroy != NULL)
+               par.match->destroy(&par);
+       module_put(par.match->me);
        return 0;
 }
 
@@ -638,7 +642,7 @@ static int check_match(struct ip6t_entry_match *m, struct xt_mtchk_param *par,
        par->match     = m->u.kernel.match;
        par->matchinfo = m->data;
 
-       ret = xt_check_match(par, NFPROTO_IPV6, m->u.match_size - sizeof(*m),
+       ret = xt_check_match(par, m->u.match_size - sizeof(*m),
                             ipv6->proto, ipv6->invflags & IP6T_INV_PROTO);
        if (ret < 0) {
                duprintf("ip_tables: check failed for `%s'.\n",
@@ -677,15 +681,20 @@ err:
 
 static int check_target(struct ip6t_entry *e, const char *name)
 {
-       struct ip6t_entry_target *t;
-       struct xt_target *target;
+       struct ip6t_entry_target *t = ip6t_get_target(e);
+       struct xt_tgchk_param par = {
+               .table     = name,
+               .entryinfo = e,
+               .target    = t->u.kernel.target,
+               .targinfo  = t->data,
+               .hook_mask = e->comefrom,
+               .family    = NFPROTO_IPV6,
+       };
        int ret;
 
        t = ip6t_get_target(e);
-       target = t->u.kernel.target;
-       ret = xt_check_target(target, AF_INET6, t->u.target_size - sizeof(*t),
-                             name, e->comefrom, e->ipv6.proto,
-                             e->ipv6.invflags & IP6T_INV_PROTO, e, t->data);
+       ret = xt_check_target(&par, t->u.target_size - sizeof(*t),
+             e->ipv6.proto, e->ipv6.invflags & IP6T_INV_PROTO);
        if (ret < 0) {
                duprintf("ip_tables: check failed for `%s'.\n",
                         t->u.kernel.target->name);
@@ -712,6 +721,7 @@ find_check_entry(struct ip6t_entry *e, const char *name, unsigned int size,
        mtpar.table     = name;
        mtpar.entryinfo = &e->ipv6;
        mtpar.hook_mask = e->comefrom;
+       mtpar.family    = NFPROTO_IPV6;
        ret = IP6T_MATCH_ITERATE(e, find_check_match, &mtpar, &j);
        if (ret != 0)
                goto cleanup_matches;
@@ -787,6 +797,7 @@ check_entry_size_and_hooks(struct ip6t_entry *e,
 static int
 cleanup_entry(struct ip6t_entry *e, unsigned int *i)
 {
+       struct xt_tgdtor_param par;
        struct ip6t_entry_target *t;
 
        if (i && (*i)-- == 0)
@@ -795,9 +806,13 @@ cleanup_entry(struct ip6t_entry *e, unsigned int *i)
        /* Cleanup all matches */
        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);
-       module_put(t->u.kernel.target->me);
+
+       par.target   = t->u.kernel.target;
+       par.targinfo = t->data;
+       par.family   = NFPROTO_IPV6;
+       if (par.target->destroy != NULL)
+               par.target->destroy(&par);
+       module_put(par.target->me);
        return 0;
 }
 
@@ -1675,6 +1690,7 @@ static int compat_check_entry(struct ip6t_entry *e, const char *name,
        mtpar.table     = name;
        mtpar.entryinfo = &e->ipv6;
        mtpar.hook_mask = e->comefrom;
+       mtpar.family    = NFPROTO_IPV6;
        ret = IP6T_MATCH_ITERATE(e, check_match, &mtpar, &j);
        if (ret)
                goto cleanup_matches;