aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/icmp.c
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2014-04-28 22:57:34 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-30 13:31:26 -0400
commit5c98631cca574ac6255885cf372f6bcf9dcfd483 (patch)
tree53e82fe083c0db2aeca000e70872f1d01e0b4146 /net/ipv6/icmp.c
parenta22adce5f97c172398082bf9a713ccfba6c2364f (diff)
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/icmp.c')
-rw-r--r--net/ipv6/icmp.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 7b326529e6a2..3b0905b77127 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -493,12 +493,7 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
493 if (IS_ERR(dst)) 493 if (IS_ERR(dst))
494 goto out; 494 goto out;
495 495
496 if (ipv6_addr_is_multicast(&fl6.daddr)) 496 hlimit = ip6_sk_dst_hoplimit(np, &fl6, dst);
497 hlimit = np->mcast_hops;
498 else
499 hlimit = np->hop_limit;
500 if (hlimit < 0)
501 hlimit = ip6_dst_hoplimit(dst);
502 497
503 msg.skb = skb; 498 msg.skb = skb;
504 msg.offset = skb_network_offset(skb); 499 msg.offset = skb_network_offset(skb);
@@ -593,12 +588,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
593 if (IS_ERR(dst)) 588 if (IS_ERR(dst))
594 goto out; 589 goto out;
595 590
596 if (ipv6_addr_is_multicast(&fl6.daddr)) 591 hlimit = ip6_sk_dst_hoplimit(np, &fl6, dst);
597 hlimit = np->mcast_hops;
598 else
599 hlimit = np->hop_limit;
600 if (hlimit < 0)
601 hlimit = ip6_dst_hoplimit(dst);
602 592
603 idev = __in6_dev_get(skb->dev); 593 idev = __in6_dev_get(skb->dev);
604 594