Skip to content

Commit

Permalink
ipv6 route: Fix lifetime in netlink.
Browse files Browse the repository at this point in the history
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: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
YOSHIFUJI Hideaki authored and David S. Miller committed May 19, 2008
1 parent a326443 commit 69cdf8f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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,
expires, rt->u.dst.error) < 0)
goto nla_put_failure;
Expand Down

0 comments on commit 69cdf8f

Please sign in to comment.