aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/netfilter/ip6table_filter.c9
-rw-r--r--net/ipv6/route.c8
2 files changed, 8 insertions, 9 deletions
diff --git a/net/ipv6/netfilter/ip6table_filter.c b/net/ipv6/netfilter/ip6table_filter.c
index a8f6da97e3b2..325e59a0224f 100644
--- a/net/ipv6/netfilter/ip6table_filter.c
+++ b/net/ipv6/netfilter/ip6table_filter.c
@@ -44,7 +44,7 @@ ip6table_filter_hook(unsigned int hook, struct sk_buff *skb,
44static struct nf_hook_ops *filter_ops __read_mostly; 44static struct nf_hook_ops *filter_ops __read_mostly;
45 45
46/* Default to forward because I got too much mail already. */ 46/* Default to forward because I got too much mail already. */
47static bool forward = NF_ACCEPT; 47static bool forward = true;
48module_param(forward, bool, 0000); 48module_param(forward, bool, 0000);
49 49
50static int __net_init ip6table_filter_net_init(struct net *net) 50static int __net_init ip6table_filter_net_init(struct net *net)
@@ -56,7 +56,7 @@ static int __net_init ip6table_filter_net_init(struct net *net)
56 return -ENOMEM; 56 return -ENOMEM;
57 /* Entry 1 is the FORWARD hook */ 57 /* Entry 1 is the FORWARD hook */
58 ((struct ip6t_standard *)repl->entries)[1].target.verdict = 58 ((struct ip6t_standard *)repl->entries)[1].target.verdict =
59 -forward - 1; 59 forward ? -NF_ACCEPT - 1 : -NF_DROP - 1;
60 60
61 net->ipv6.ip6table_filter = 61 net->ipv6.ip6table_filter =
62 ip6t_register_table(net, &packet_filter, repl); 62 ip6t_register_table(net, &packet_filter, repl);
@@ -80,11 +80,6 @@ static int __init ip6table_filter_init(void)
80{ 80{
81 int ret; 81 int ret;
82 82
83 if (forward < 0 || forward > NF_MAX_VERDICT) {
84 pr_err("iptables forward must be 0 or 1\n");
85 return -EINVAL;
86 }
87
88 ret = register_pernet_subsys(&ip6table_filter_net_ops); 83 ret = register_pernet_subsys(&ip6table_filter_net_ops);
89 if (ret < 0) 84 if (ret < 0)
90 return ret; 85 return ret;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 24c456e8aa1d..496b62712fe8 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2474,8 +2474,12 @@ static int rt6_fill_node(struct net *net,
2474 2474
2475 rcu_read_lock(); 2475 rcu_read_lock();
2476 n = dst_get_neighbour_noref(&rt->dst); 2476 n = dst_get_neighbour_noref(&rt->dst);
2477 if (n) 2477 if (n) {
2478 NLA_PUT(skb, RTA_GATEWAY, 16, &n->primary_key); 2478 if (nla_put(skb, RTA_GATEWAY, 16, &n->primary_key) < 0) {
2479 rcu_read_unlock();
2480 goto nla_put_failure;
2481 }
2482 }
2479 rcu_read_unlock(); 2483 rcu_read_unlock();
2480 2484
2481 if (rt->dst.dev) 2485 if (rt->dst.dev)