aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-03-20 21:02:15 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-20 21:02:15 -0500
commit1c524830d0b39472f0278989bf1119750a5e234d (patch)
tree9c60dd1717ddf458f66c4a71cb41c3ef7186cdd3 /net/ipv6
parent5d04bff096180f032de8b9b12153a8a1b4009b8d (diff)
[NETFILTER]: x_tables: pass registered match/target data to match/target functions
This allows to make decisions based on the revision (and address family with a follow-up patch) at runtime. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/netfilter/ip6_tables.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index e2e8d0140d7b..1b32a2d1e9e0 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -251,7 +251,7 @@ int do_match(struct ip6t_entry_match *m,
251 int *hotdrop) 251 int *hotdrop)
252{ 252{
253 /* Stop iteration if it doesn't match */ 253 /* Stop iteration if it doesn't match */
254 if (!m->u.kernel.match->match(skb, in, out, m->data, 254 if (!m->u.kernel.match->match(skb, in, out, m->u.kernel.match, m->data,
255 offset, protoff, hotdrop)) 255 offset, protoff, hotdrop))
256 return 1; 256 return 1;
257 else 257 else
@@ -373,6 +373,7 @@ ip6t_do_table(struct sk_buff **pskb,
373 verdict = t->u.kernel.target->target(pskb, 373 verdict = t->u.kernel.target->target(pskb,
374 in, out, 374 in, out,
375 hook, 375 hook,
376 t->u.kernel.target,
376 t->data, 377 t->data,
377 userdata); 378 userdata);
378 379
@@ -531,7 +532,7 @@ cleanup_match(struct ip6t_entry_match *m, unsigned int *i)
531 return 1; 532 return 1;
532 533
533 if (m->u.kernel.match->destroy) 534 if (m->u.kernel.match->destroy)
534 m->u.kernel.match->destroy(m->data, 535 m->u.kernel.match->destroy(m->u.kernel.match, m->data,
535 m->u.match_size - sizeof(*m)); 536 m->u.match_size - sizeof(*m));
536 module_put(m->u.kernel.match->me); 537 module_put(m->u.kernel.match->me);
537 return 0; 538 return 0;
@@ -584,7 +585,7 @@ check_match(struct ip6t_entry_match *m,
584 goto err; 585 goto err;
585 586
586 if (m->u.kernel.match->checkentry 587 if (m->u.kernel.match->checkentry
587 && !m->u.kernel.match->checkentry(name, ipv6, m->data, 588 && !m->u.kernel.match->checkentry(name, ipv6, match, m->data,
588 m->u.match_size - sizeof(*m), 589 m->u.match_size - sizeof(*m),
589 hookmask)) { 590 hookmask)) {
590 duprintf("ip_tables: check failed for `%s'.\n", 591 duprintf("ip_tables: check failed for `%s'.\n",
@@ -645,7 +646,7 @@ check_entry(struct ip6t_entry *e, const char *name, unsigned int size,
645 goto cleanup_matches; 646 goto cleanup_matches;
646 } 647 }
647 } else if (t->u.kernel.target->checkentry 648 } else if (t->u.kernel.target->checkentry
648 && !t->u.kernel.target->checkentry(name, e, t->data, 649 && !t->u.kernel.target->checkentry(name, e, target, t->data,
649 t->u.target_size 650 t->u.target_size
650 - sizeof(*t), 651 - sizeof(*t),
651 e->comefrom)) { 652 e->comefrom)) {
@@ -719,7 +720,7 @@ cleanup_entry(struct ip6t_entry *e, unsigned int *i)
719 IP6T_MATCH_ITERATE(e, cleanup_match, NULL); 720 IP6T_MATCH_ITERATE(e, cleanup_match, NULL);
720 t = ip6t_get_target(e); 721 t = ip6t_get_target(e);
721 if (t->u.kernel.target->destroy) 722 if (t->u.kernel.target->destroy)
722 t->u.kernel.target->destroy(t->data, 723 t->u.kernel.target->destroy(t->u.kernel.target, t->data,
723 t->u.target_size - sizeof(*t)); 724 t->u.target_size - sizeof(*t));
724 module_put(t->u.kernel.target->me); 725 module_put(t->u.kernel.target->me);
725 return 0; 726 return 0;