summaryrefslogtreecommitdiffstats
path: root/net/ipv6/ping.c
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2014-04-29 11:57:34 +0900
committerDavid S. Miller <davem@davemloft.net>2014-04-30 13:31:26 -0400
commit5c98631cca574ac6255885cf372f6bcf9dcfd483 (patch)
tree53e82fe083c0db2aeca000e70872f1d01e0b4146 /net/ipv6/ping.c
parenta22adce5f97c172398082bf9a713ccfba6c2364f (diff)
downloadlinux-5c98631cca574ac6255885cf372f6bcf9dcfd483.tar.bz2
net: ipv6: Introduce ip6_sk_dst_hoplimit.
This replaces 6 identical code snippets with a call to a new static inline function. Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ping.c')
-rw-r--r--net/ipv6/ping.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index bda74291c3e0..a2a1d80dfe0c 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -168,12 +168,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
pfh.wcheck = 0;
pfh.family = AF_INET6;
- if (ipv6_addr_is_multicast(&fl6.daddr))
- hlimit = np->mcast_hops;
- else
- hlimit = np->hop_limit;
- if (hlimit < 0)
- hlimit = ip6_dst_hoplimit(dst);
+ hlimit = ip6_sk_dst_hoplimit(np, &fl6, dst);
lock_sock(sk);
err = ip6_append_data(sk, ping_getfrag, &pfh, len,