Commit db138ef2 authored by Li RongQing's avatar Li RongQing Committed by Greg Kroah-Hartman

ipv6: Set default hoplimit as zero.

[ Upstream commit 14edd87d ]

Commit a02e4b7d(Demark default hoplimit as zero) only changes the
hoplimit checking condition and default value in ip6_dst_hoplimit, not
zeros all hoplimit default value.

Keep the zeroing ip6_template_metrics[RTAX_HOPLIMIT - 1] to force it as
const, cause as a37e6e34(net: force dst_default_metrics to const
section)
Signed-off-by: default avatarLi RongQing <roy.qing.li@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3297d60d
...@@ -171,7 +171,7 @@ static struct dst_ops ip6_dst_blackhole_ops = { ...@@ -171,7 +171,7 @@ static struct dst_ops ip6_dst_blackhole_ops = {
}; };
static const u32 ip6_template_metrics[RTAX_MAX] = { static const u32 ip6_template_metrics[RTAX_MAX] = {
[RTAX_HOPLIMIT - 1] = 255, [RTAX_HOPLIMIT - 1] = 0,
}; };
static struct rt6_info ip6_null_entry_template = { static struct rt6_info ip6_null_entry_template = {
...@@ -1068,7 +1068,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev, ...@@ -1068,7 +1068,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
rt->rt6i_idev = idev; rt->rt6i_idev = idev;
dst_set_neighbour(&rt->dst, neigh); dst_set_neighbour(&rt->dst, neigh);
atomic_set(&rt->dst.__refcnt, 1); atomic_set(&rt->dst.__refcnt, 1);
dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 255); dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 0);
rt->dst.output = ip6_output; rt->dst.output = ip6_output;
spin_lock_bh(&icmp6_dst_lock); spin_lock_bh(&icmp6_dst_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment