From 9a09c816fcee7be6b808b4c1f761870b32428b0c Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Tue, 12 Dec 2006 17:09:49 -0800 Subject: [PATCH] --- yaml --- r: 44596 b: refs/heads/master c: befffe901649e2cc421d0d150c4379d01658cf6b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/ipv6/ipv6_sockglue.c | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 8a8a7fd3b1f0..c627e7ea41be 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 832e3ca62d6ee1893db05f5202c24ae5331e19ba +refs/heads/master: befffe901649e2cc421d0d150c4379d01658cf6b diff --git a/trunk/net/ipv6/ipv6_sockglue.c b/trunk/net/ipv6/ipv6_sockglue.c index 1eafcfc95e81..352690e2ab82 100644 --- a/trunk/net/ipv6/ipv6_sockglue.c +++ b/trunk/net/ipv6/ipv6_sockglue.c @@ -978,12 +978,27 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, break; case IPV6_UNICAST_HOPS: - val = np->hop_limit; - break; - case IPV6_MULTICAST_HOPS: - val = np->mcast_hops; + { + struct dst_entry *dst; + + if (optname == IPV6_UNICAST_HOPS) + val = np->hop_limit; + else + val = np->mcast_hops; + + dst = sk_dst_get(sk); + if (dst) { + if (val < 0) + val = dst_metric(dst, RTAX_HOPLIMIT); + if (val < 0) + val = ipv6_get_hoplimit(dst->dev); + dst_release(dst); + } + if (val < 0) + val = ipv6_devconf.hop_limit; break; + } case IPV6_MULTICAST_LOOP: val = np->mc_loop;