aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/netfilter/ip6t_REJECT.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-03-20 18:01:43 -0800
committerDavid S. Miller <davem@davemloft.net>2006-03-20 18:01:43 -0800
commit7f9397138e297904bf1c717651183e785a01ff13 (patch)
tree67b39ba381e8ffd2340d002a118252be0fc2e923 /net/ipv6/netfilter/ip6t_REJECT.c
parent[NETFILTER]: Convert arp_tables targets to centralized error checking (diff)
downloadlinux-dev-7f9397138e297904bf1c717651183e785a01ff13.tar.xz
linux-dev-7f9397138e297904bf1c717651183e785a01ff13.zip
[NETFILTER]: Convert ip6_tables matches/targets to centralized error checking
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/netfilter/ip6t_REJECT.c')
-rw-r--r--net/ipv6/netfilter/ip6t_REJECT.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c
index 0e6d1d4bbd5c..86407060f6da 100644
--- a/net/ipv6/netfilter/ip6t_REJECT.c
+++ b/net/ipv6/netfilter/ip6t_REJECT.c
@@ -228,24 +228,6 @@ static int check(const char *tablename,
const struct ip6t_reject_info *rejinfo = targinfo;
const struct ip6t_entry *e = entry;
- if (targinfosize != IP6T_ALIGN(sizeof(struct ip6t_reject_info))) {
- DEBUGP("ip6t_REJECT: targinfosize %u != 0\n", targinfosize);
- return 0;
- }
-
- /* Only allow these for packet filtering. */
- if (strcmp(tablename, "filter") != 0) {
- DEBUGP("ip6t_REJECT: bad table `%s'.\n", tablename);
- return 0;
- }
-
- if ((hook_mask & ~((1 << NF_IP6_LOCAL_IN)
- | (1 << NF_IP6_FORWARD)
- | (1 << NF_IP6_LOCAL_OUT))) != 0) {
- DEBUGP("ip6t_REJECT: bad hook mask %X\n", hook_mask);
- return 0;
- }
-
if (rejinfo->with == IP6T_ICMP6_ECHOREPLY) {
printk("ip6t_REJECT: ECHOREPLY is not supported.\n");
return 0;
@@ -257,13 +239,16 @@ static int check(const char *tablename,
return 0;
}
}
-
return 1;
}
static struct ip6t_target ip6t_reject_reg = {
.name = "REJECT",
.target = reject6_target,
+ .targetsize = sizeof(struct ip6t_reject_info),
+ .table = "filter",
+ .hooks = (1 << NF_IP6_LOCAL_IN) | (1 << NF_IP6_FORWARD) |
+ (1 << NF_IP6_LOCAL_OUT),
.checkentry = check,
.me = THIS_MODULE
};