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

Commit 69cdf8f9 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller
Browse files

ipv6 route: Fix lifetime in netlink.



We could not see appropriate lifetime if the route had been scheduled
to expired at 0 (in jiffies).  We should check rt6i_flags instead of
rt6i_expires to determine whether lifetime is valid or not.

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a3264435
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -2200,7 +2200,9 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt,


	NLA_PUT_U32(skb, RTA_PRIORITY, rt->rt6i_metric);
	NLA_PUT_U32(skb, RTA_PRIORITY, rt->rt6i_metric);


	expires = rt->rt6i_expires ? rt->rt6i_expires - jiffies : 0;
	expires = (rt->rt6i_flags & RTF_EXPIRES) ?
			rt->rt6i_expires - jiffies : 0;

	if (rtnl_put_cacheinfo(skb, &rt->u.dst, 0, 0, 0,
	if (rtnl_put_cacheinfo(skb, &rt->u.dst, 0, 0, 0,
			       expires, rt->u.dst.error) < 0)
			       expires, rt->u.dst.error) < 0)
		goto nla_put_failure;
		goto nla_put_failure;