From: David S. Miller <davem@davemloft.net>
Date: Mon, 13 Dec 2010 05:39:02 +0000 (-0800)
Subject: ipv6: Demark default hoplimit as zero.
X-Git-Tag: firefly_0821_release~7613^2~3122^2~195
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a02e4b7d;p=firefly-linux-kernel-4.4.55.git

ipv6: Demark default hoplimit as zero.

This is for consistency with ipv4.  Using "-1" makes
no sense.

It was made this way a long time ago merely to be consistent
with how the ipv6 socket hoplimit "default" is stored.

Signed-off-by: David S. Miller <davem@davemloft.net>
---

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index d9405d1863b8..98796b0dc2b7 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1105,7 +1105,7 @@ static int ipv6_get_mtu(struct net_device *dev)
 int ip6_dst_hoplimit(struct dst_entry *dst)
 {
 	int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT);
-	if (hoplimit < 0) {
+	if (hoplimit == 0) {
 		struct net_device *dev = dst->dev;
 		struct inet6_dev *idev;
 
@@ -1310,8 +1310,6 @@ install_route:
 		}
 	}
 
-	if (dst_metric_raw(&rt->dst, RTAX_HOPLIMIT) == 0)
-		dst_metric_set(&rt->dst, RTAX_HOPLIMIT, -1);
 	if (!dst_mtu(&rt->dst))
 		dst_metric_set(&rt->dst, RTAX_MTU, ipv6_get_mtu(dev));
 	if (!dst_metric(&rt->dst, RTAX_ADVMSS))