Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15233
b: refs/heads/master
c: 3dd4bc6
h: refs/heads/master
i:
  15231: 2b27ce5
v: v3
  • Loading branch information
YOSHIFUJI Hideaki authored and David S. Miller committed Dec 19, 2005
1 parent 8918ec8 commit c004017
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b03664869aa6f84c3c98a06ac9d6905b195909bc
refs/heads/master: 3dd4bc68fac5df16b6d3ed6ed3c29cf05f29a47e
16 changes: 12 additions & 4 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,9 +1596,17 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len)
not good.
*/
if (valid_lft >= 0x7FFFFFFF/HZ)
rt_expires = 0;
rt_expires = 0x7FFFFFFF - (0x7FFFFFFF % HZ);
else
rt_expires = jiffies + valid_lft * HZ;
rt_expires = valid_lft * HZ;

/*
* We convert this (in jiffies) to clock_t later.
* Avoid arithmetic overflow there as well.
* Overflow can happen only if HZ < USER_HZ.
*/
if (HZ < USER_HZ && rt_expires > 0x7FFFFFFF / USER_HZ)
rt_expires = 0x7FFFFFFF / USER_HZ;

if (pinfo->onlink) {
struct rt6_info *rt;
Expand All @@ -1610,12 +1618,12 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len)
ip6_del_rt(rt, NULL, NULL, NULL);
rt = NULL;
} else {
rt->rt6i_expires = rt_expires;
rt->rt6i_expires = jiffies + rt_expires;
}
}
} else if (valid_lft) {
addrconf_prefix_route(&pinfo->prefix, pinfo->prefix_len,
dev, rt_expires, RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT);
dev, jiffies_to_clock_t(rt_expires), RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT);
}
if (rt)
dst_release(&rt->u.dst);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh,
}

rt->u.dst.obsolete = -1;
rt->rt6i_expires = clock_t_to_jiffies(rtmsg->rtmsg_info);
rt->rt6i_expires = jiffies + clock_t_to_jiffies(rtmsg->rtmsg_info);
if (nlh && (r = NLMSG_DATA(nlh))) {
rt->rt6i_protocol = r->rtm_protocol;
} else {
Expand Down

0 comments on commit c004017

Please sign in to comment.