Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b75d090 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki
Browse files

[IPV6]: Optimize hop-limit determination.



Last part of hop-limit determination is always:
    hoplimit = dst_metric(dst, RTAX_HOPLIMIT);
    if (hoplimit < 0)
        hoplimit = ipv6_get_hoplimit(dst->dev).

Let's consolidate it as ip6_dst_hoplimit(dst).

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
parent 47254745
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -123,8 +123,6 @@ extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr);

extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len);

extern int ipv6_get_hoplimit(struct net_device *dev);

/*
 *	anycast prototypes (anycast.c)
 */
+2 −0
Original line number Diff line number Diff line
@@ -88,6 +88,8 @@ extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
					   const struct in6_addr *addr,
					   int anycast);

extern int			ip6_dst_hoplimit(struct dst_entry *dst);

/*
 *	support functions for ND
 *
+2 −6
Original line number Diff line number Diff line
@@ -464,9 +464,7 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
	else
		hlimit = np->hop_limit;
	if (hlimit < 0)
		hlimit = dst_metric(dst, RTAX_HOPLIMIT);
	if (hlimit < 0)
		hlimit = ipv6_get_hoplimit(dst->dev);
		hlimit = ip6_dst_hoplimit(dst);

	tclass = np->tclass;
	if (tclass < 0)
@@ -560,9 +558,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
	else
		hlimit = np->hop_limit;
	if (hlimit < 0)
		hlimit = dst_metric(dst, RTAX_HOPLIMIT);
	if (hlimit < 0)
		hlimit = ipv6_get_hoplimit(dst->dev);
		hlimit = ip6_dst_hoplimit(dst);

	tclass = np->tclass;
	if (tclass < 0)
+1 −3
Original line number Diff line number Diff line
@@ -237,9 +237,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
	if (np)
		hlimit = np->hop_limit;
	if (hlimit < 0)
		hlimit = dst_metric(dst, RTAX_HOPLIMIT);
	if (hlimit < 0)
		hlimit = ipv6_get_hoplimit(dst->dev);
		hlimit = ip6_dst_hoplimit(dst);

	tclass = -1;
	if (np)
+1 −3
Original line number Diff line number Diff line
@@ -904,9 +904,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
		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);
				val = ip6_dst_hoplimit(dst);
			dst_release(dst);
		}
		if (val < 0)
Loading