diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/iptable_filter.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/net/ipv4/netfilter/iptable_filter.c b/net/ipv4/netfilter/iptable_filter.c index 0e58f09e59fb..851acec852d2 100644 --- a/net/ipv4/netfilter/iptable_filter.c +++ b/net/ipv4/netfilter/iptable_filter.c | |||
@@ -52,7 +52,7 @@ iptable_filter_hook(unsigned int hook, struct sk_buff *skb, | |||
52 | static struct nf_hook_ops *filter_ops __read_mostly; | 52 | static struct nf_hook_ops *filter_ops __read_mostly; |
53 | 53 | ||
54 | /* Default to forward because I got too much mail already. */ | 54 | /* Default to forward because I got too much mail already. */ |
55 | static bool forward = NF_ACCEPT; | 55 | static bool forward = true; |
56 | module_param(forward, bool, 0000); | 56 | module_param(forward, bool, 0000); |
57 | 57 | ||
58 | static int __net_init iptable_filter_net_init(struct net *net) | 58 | static int __net_init iptable_filter_net_init(struct net *net) |
@@ -64,7 +64,7 @@ static int __net_init iptable_filter_net_init(struct net *net) | |||
64 | return -ENOMEM; | 64 | return -ENOMEM; |
65 | /* Entry 1 is the FORWARD hook */ | 65 | /* Entry 1 is the FORWARD hook */ |
66 | ((struct ipt_standard *)repl->entries)[1].target.verdict = | 66 | ((struct ipt_standard *)repl->entries)[1].target.verdict = |
67 | -forward - 1; | 67 | forward ? -NF_ACCEPT - 1 : -NF_DROP - 1; |
68 | 68 | ||
69 | net->ipv4.iptable_filter = | 69 | net->ipv4.iptable_filter = |
70 | ipt_register_table(net, &packet_filter, repl); | 70 | ipt_register_table(net, &packet_filter, repl); |
@@ -88,11 +88,6 @@ static int __init iptable_filter_init(void) | |||
88 | { | 88 | { |
89 | int ret; | 89 | int ret; |
90 | 90 | ||
91 | if (forward < 0 || forward > NF_MAX_VERDICT) { | ||
92 | pr_err("iptables forward must be 0 or 1\n"); | ||
93 | return -EINVAL; | ||
94 | } | ||
95 | |||
96 | ret = register_pernet_subsys(&iptable_filter_net_ops); | 91 | ret = register_pernet_subsys(&iptable_filter_net_ops); |
97 | if (ret < 0) | 92 | if (ret < 0) |
98 | return ret; | 93 | return ret; |