diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 1eafcfc95e81..352690e2ab82 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -978,12 +978,27 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
978 | break; | 978 | break; |
979 | 979 | ||
980 | case IPV6_UNICAST_HOPS: | 980 | case IPV6_UNICAST_HOPS: |
981 | val = np->hop_limit; | ||
982 | break; | ||
983 | |||
984 | case IPV6_MULTICAST_HOPS: | 981 | case IPV6_MULTICAST_HOPS: |
985 | val = np->mcast_hops; | 982 | { |
983 | struct dst_entry *dst; | ||
984 | |||
985 | if (optname == IPV6_UNICAST_HOPS) | ||
986 | val = np->hop_limit; | ||
987 | else | ||
988 | val = np->mcast_hops; | ||
989 | |||
990 | dst = sk_dst_get(sk); | ||
991 | if (dst) { | ||
992 | if (val < 0) | ||
993 | val = dst_metric(dst, RTAX_HOPLIMIT); | ||
994 | if (val < 0) | ||
995 | val = ipv6_get_hoplimit(dst->dev); | ||
996 | dst_release(dst); | ||
997 | } | ||
998 | if (val < 0) | ||
999 | val = ipv6_devconf.hop_limit; | ||
986 | break; | 1000 | break; |
1001 | } | ||
987 | 1002 | ||
988 | case IPV6_MULTICAST_LOOP: | 1003 | case IPV6_MULTICAST_LOOP: |
989 | val = np->mc_loop; | 1004 | val = np->mc_loop; |