diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2008-10-08 05:35:19 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-10-08 05:35:19 -0400 |
commit | af5d6dc200eb0fcc6fbd3df1ab4d8969004cb37f (patch) | |
tree | 06f5805d0a98a421f23380bdb044f93216204b9d /net/ipv6 | |
parent | 7eb3558655aaa87a3e71a0c065dfaddda521fa6d (diff) |
netfilter: xtables: move extension arguments into compound structure (5/6)
This patch does this for target extensions' checkentry functions.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 16 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_HL.c | 7 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_LOG.c | 7 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_REJECT.c | 9 |
4 files changed, 17 insertions, 22 deletions
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index ee0986cdbd66..ca14fb8bd362 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -679,15 +679,19 @@ err: | |||
679 | 679 | ||
680 | static int check_target(struct ip6t_entry *e, const char *name) | 680 | static int check_target(struct ip6t_entry *e, const char *name) |
681 | { | 681 | { |
682 | struct ip6t_entry_target *t; | 682 | struct ip6t_entry_target *t = ip6t_get_target(e); |
683 | struct xt_target *target; | 683 | struct xt_tgchk_param par = { |
684 | .table = name, | ||
685 | .entryinfo = e, | ||
686 | .target = t->u.kernel.target, | ||
687 | .targinfo = t->data, | ||
688 | .hook_mask = e->comefrom, | ||
689 | }; | ||
684 | int ret; | 690 | int ret; |
685 | 691 | ||
686 | t = ip6t_get_target(e); | 692 | t = ip6t_get_target(e); |
687 | target = t->u.kernel.target; | 693 | ret = xt_check_target(&par, NFPROTO_IPV6, t->u.target_size - sizeof(*t), |
688 | ret = xt_check_target(target, AF_INET6, t->u.target_size - sizeof(*t), | 694 | e->ipv6.proto, e->ipv6.invflags & IP6T_INV_PROTO); |
689 | name, e->comefrom, e->ipv6.proto, | ||
690 | e->ipv6.invflags & IP6T_INV_PROTO, e, t->data); | ||
691 | if (ret < 0) { | 695 | if (ret < 0) { |
692 | duprintf("ip_tables: check failed for `%s'.\n", | 696 | duprintf("ip_tables: check failed for `%s'.\n", |
693 | t->u.kernel.target->name); | 697 | t->u.kernel.target->name); |
diff --git a/net/ipv6/netfilter/ip6t_HL.c b/net/ipv6/netfilter/ip6t_HL.c index ac759a54f2c6..27b5adf670a2 100644 --- a/net/ipv6/netfilter/ip6t_HL.c +++ b/net/ipv6/netfilter/ip6t_HL.c | |||
@@ -54,12 +54,9 @@ hl_tg6(struct sk_buff *skb, const struct xt_target_param *par) | |||
54 | return XT_CONTINUE; | 54 | return XT_CONTINUE; |
55 | } | 55 | } |
56 | 56 | ||
57 | static bool | 57 | static bool hl_tg6_check(const struct xt_tgchk_param *par) |
58 | hl_tg6_check(const char *tablename, const void *entry, | ||
59 | const struct xt_target *target, void *targinfo, | ||
60 | unsigned int hook_mask) | ||
61 | { | 58 | { |
62 | const struct ip6t_HL_info *info = targinfo; | 59 | const struct ip6t_HL_info *info = par->targinfo; |
63 | 60 | ||
64 | if (info->mode > IP6T_HL_MAXMODE) { | 61 | if (info->mode > IP6T_HL_MAXMODE) { |
65 | printk(KERN_WARNING "ip6t_HL: invalid or unknown Mode %u\n", | 62 | printk(KERN_WARNING "ip6t_HL: invalid or unknown Mode %u\n", |
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c index a31d3ecd1fc9..caa441d09567 100644 --- a/net/ipv6/netfilter/ip6t_LOG.c +++ b/net/ipv6/netfilter/ip6t_LOG.c | |||
@@ -453,12 +453,9 @@ log_tg6(struct sk_buff *skb, const struct xt_target_param *par) | |||
453 | } | 453 | } |
454 | 454 | ||
455 | 455 | ||
456 | static bool | 456 | static bool log_tg6_check(const struct xt_tgchk_param *par) |
457 | log_tg6_check(const char *tablename, const void *entry, | ||
458 | const struct xt_target *target, void *targinfo, | ||
459 | unsigned int hook_mask) | ||
460 | { | 457 | { |
461 | const struct ip6t_log_info *loginfo = targinfo; | 458 | const struct ip6t_log_info *loginfo = par->targinfo; |
462 | 459 | ||
463 | if (loginfo->level >= 8) { | 460 | if (loginfo->level >= 8) { |
464 | pr_debug("LOG: level %u >= 8\n", loginfo->level); | 461 | pr_debug("LOG: level %u >= 8\n", loginfo->level); |
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c index 1d5f3a70ed09..0981b4ccb8b1 100644 --- a/net/ipv6/netfilter/ip6t_REJECT.c +++ b/net/ipv6/netfilter/ip6t_REJECT.c | |||
@@ -213,13 +213,10 @@ reject_tg6(struct sk_buff *skb, const struct xt_target_param *par) | |||
213 | return NF_DROP; | 213 | return NF_DROP; |
214 | } | 214 | } |
215 | 215 | ||
216 | static bool | 216 | static bool reject_tg6_check(const struct xt_tgchk_param *par) |
217 | reject_tg6_check(const char *tablename, const void *entry, | ||
218 | const struct xt_target *target, void *targinfo, | ||
219 | unsigned int hook_mask) | ||
220 | { | 217 | { |
221 | const struct ip6t_reject_info *rejinfo = targinfo; | 218 | const struct ip6t_reject_info *rejinfo = par->targinfo; |
222 | const struct ip6t_entry *e = entry; | 219 | const struct ip6t_entry *e = par->entryinfo; |
223 | 220 | ||
224 | if (rejinfo->with == IP6T_ICMP6_ECHOREPLY) { | 221 | if (rejinfo->with == IP6T_ICMP6_ECHOREPLY) { |
225 | printk("ip6t_REJECT: ECHOREPLY is not supported.\n"); | 222 | printk("ip6t_REJECT: ECHOREPLY is not supported.\n"); |