net: ipv6: Introduce ip6_sk_dst_hoplimit.
[firefly-linux-kernel-4.4.55.git] / net / l2tp / l2tp_ip6.c
index 7704ea9502fdc9e49a2b8bb7fda4b9b9ec8d1722..e472d44a3b91eb74e5614d22c4c7c68811ca4a84 100644 (file)
@@ -605,14 +605,8 @@ static int l2tp_ip6_sendmsg(struct kiocb *iocb, struct sock *sk,
                goto out;
        }
 
-       if (hlimit < 0) {
-               if (ipv6_addr_is_multicast(&fl6.daddr))
-                       hlimit = np->mcast_hops;
-               else
-                       hlimit = np->hop_limit;
-               if (hlimit < 0)
-                       hlimit = ip6_dst_hoplimit(dst);
-       }
+       if (hlimit < 0)
+               hlimit = ip6_sk_dst_hoplimit(np, &fl6, dst);
 
        if (tclass < 0)
                tclass = np->tclass;