Skip to content

Commit a02e4b7

Browse files
committed
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>
1 parent 5170ae8 commit a02e4b7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

net/ipv6/route.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ static int ipv6_get_mtu(struct net_device *dev)
11051105
int ip6_dst_hoplimit(struct dst_entry *dst)
11061106
{
11071107
int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT);
1108-
if (hoplimit < 0) {
1108+
if (hoplimit == 0) {
11091109
struct net_device *dev = dst->dev;
11101110
struct inet6_dev *idev;
11111111

@@ -1310,8 +1310,6 @@ int ip6_route_add(struct fib6_config *cfg)
13101310
}
13111311
}
13121312

1313-
if (dst_metric_raw(&rt->dst, RTAX_HOPLIMIT) == 0)
1314-
dst_metric_set(&rt->dst, RTAX_HOPLIMIT, -1);
13151313
if (!dst_mtu(&rt->dst))
13161314
dst_metric_set(&rt->dst, RTAX_MTU, ipv6_get_mtu(dev));
13171315
if (!dst_metric(&rt->dst, RTAX_ADVMSS))

0 commit comments

Comments
 (0)