]> 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 ee0986cdbd667eaa625925a715cc86150e497943..a33485dc81cb107e1cc343a764126325c9db2c05 100644 (file)
@@ -370,6 +370,7 @@ ip6t_do_table(struct sk_buff *skb,
        mtpar.hotdrop = &hotdrop;
        mtpar.in      = tgpar.in  = in;
        mtpar.out     = tgpar.out = out;
+       mtpar.family  = tgpar.family = NFPROTO_IPV6;
        tgpar.hooknum = hook;
 
        read_lock_bh(&table->lock);
@@ -604,6 +605,7 @@ cleanup_match(struct ip6t_entry_match *m, unsigned int *i)
 
        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);
@@ -640,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",
@@ -679,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);
@@ -714,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;
@@ -789,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)
@@ -797,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;
 }
 
@@ -1677,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;