Use monotonic 'time_uptime' instead of 'time_second' as timebase
for rt->rt_rmx.rmx_expire.
This commit is contained in:
parent
e6b9152d20
commit
fe53256dc2
@ -1301,7 +1301,7 @@ rt_check(struct rtentry **lrt, struct rtentry **lrt0, struct sockaddr *dst)
|
||||
/* XXX why are we inspecting rmx_expire? */
|
||||
error = (rt->rt_flags & RTF_REJECT) &&
|
||||
(rt->rt_rmx.rmx_expire == 0 ||
|
||||
time_second < rt->rt_rmx.rmx_expire);
|
||||
time_uptime < rt->rt_rmx.rmx_expire);
|
||||
if (error) {
|
||||
RT_UNLOCK(rt);
|
||||
senderr(rt == rt0 ? EHOSTDOWN : EHOSTUNREACH);
|
||||
|
@ -144,7 +144,7 @@ arptimer(void * __unused unused)
|
||||
struct rtentry *rt = la->la_rt;
|
||||
|
||||
RT_LOCK(rt);
|
||||
if (rt->rt_expire && rt->rt_expire <= time_second) {
|
||||
if (rt->rt_expire && rt->rt_expire <= time_uptime) {
|
||||
struct sockaddr_dl *sdl = SDL(rt->rt_gateway);
|
||||
|
||||
KASSERT(sdl->sdl_family == AF_LINK, ("sdl_family %d",
|
||||
@ -213,7 +213,7 @@ arp_rtrequest(req, rt, info)
|
||||
gate = rt->rt_gateway;
|
||||
SDL(gate)->sdl_type = rt->rt_ifp->if_type;
|
||||
SDL(gate)->sdl_index = rt->rt_ifp->if_index;
|
||||
rt->rt_expire = time_second;
|
||||
rt->rt_expire = time_uptime;
|
||||
break;
|
||||
}
|
||||
/* Announce a new entry if requested. */
|
||||
@ -443,7 +443,7 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
|
||||
* Check the address family and length is valid, the address
|
||||
* is resolved; otherwise, try to resolve.
|
||||
*/
|
||||
if ((rt->rt_expire == 0 || rt->rt_expire > time_second) &&
|
||||
if ((rt->rt_expire == 0 || rt->rt_expire > time_uptime) &&
|
||||
sdl->sdl_family == AF_LINK && sdl->sdl_alen != 0) {
|
||||
|
||||
bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
|
||||
@ -454,7 +454,7 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
|
||||
* arpt_down interval.
|
||||
*/
|
||||
if ((rt->rt_expire != 0) &&
|
||||
(time_second + la->la_preempt > rt->rt_expire)) {
|
||||
(time_uptime + la->la_preempt > rt->rt_expire)) {
|
||||
struct in_addr sin =
|
||||
SIN(rt->rt_ifa->ifa_addr)->sin_addr;
|
||||
|
||||
@ -489,8 +489,8 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
|
||||
la->la_hold = m;
|
||||
if (rt->rt_expire) {
|
||||
rt->rt_flags &= ~RTF_REJECT;
|
||||
if (la->la_asked == 0 || rt->rt_expire != time_second) {
|
||||
rt->rt_expire = time_second;
|
||||
if (la->la_asked == 0 || rt->rt_expire != time_uptime) {
|
||||
rt->rt_expire = time_uptime;
|
||||
if (la->la_asked++ < arp_maxtries) {
|
||||
struct in_addr sin =
|
||||
SIN(rt->rt_ifa->ifa_addr)->sin_addr;
|
||||
@ -787,7 +787,7 @@ match:
|
||||
th->rcf = trld->trld_rcf;
|
||||
}
|
||||
if (rt->rt_expire)
|
||||
rt->rt_expire = time_second + arpt_keep;
|
||||
rt->rt_expire = time_uptime + arpt_keep;
|
||||
rt->rt_flags &= ~RTF_REJECT;
|
||||
la->la_asked = 0;
|
||||
la->la_preempt = arp_maxtries;
|
||||
|
@ -190,7 +190,7 @@ in_clsroute(struct radix_node *rn, struct radix_node_head *head)
|
||||
*/
|
||||
if (rtq_reallyold != 0) {
|
||||
rt->rt_flags |= RTPRF_OURS;
|
||||
rt->rt_rmx.rmx_expire = time_second + rtq_reallyold;
|
||||
rt->rt_rmx.rmx_expire = time_uptime + rtq_reallyold;
|
||||
} else {
|
||||
rtexpunge(rt);
|
||||
}
|
||||
@ -220,7 +220,7 @@ in_rtqkill(struct radix_node *rn, void *rock)
|
||||
if (rt->rt_flags & RTPRF_OURS) {
|
||||
ap->found++;
|
||||
|
||||
if (ap->draining || rt->rt_rmx.rmx_expire <= time_second) {
|
||||
if (ap->draining || rt->rt_rmx.rmx_expire <= time_uptime) {
|
||||
if (rt->rt_refcnt > 0)
|
||||
panic("rtqkill route really not free");
|
||||
|
||||
@ -235,10 +235,10 @@ in_rtqkill(struct radix_node *rn, void *rock)
|
||||
}
|
||||
} else {
|
||||
if (ap->updating &&
|
||||
(rt->rt_rmx.rmx_expire - time_second >
|
||||
(rt->rt_rmx.rmx_expire - time_uptime >
|
||||
rtq_reallyold)) {
|
||||
rt->rt_rmx.rmx_expire =
|
||||
time_second + rtq_reallyold;
|
||||
time_uptime + rtq_reallyold;
|
||||
}
|
||||
ap->nextstop = lmin(ap->nextstop,
|
||||
rt->rt_rmx.rmx_expire);
|
||||
|
@ -495,7 +495,7 @@ passout:
|
||||
* Check if route is dampned (when ARP is unable to resolve)
|
||||
*/
|
||||
if ((ro.ro_rt->rt_flags & RTF_REJECT) &&
|
||||
ro.ro_rt->rt_rmx.rmx_expire >= time_second) {
|
||||
ro.ro_rt->rt_rmx.rmx_expire >= time_uptime) {
|
||||
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0);
|
||||
goto consumed;
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ in6_clsroute(struct radix_node *rn, struct radix_node_head *head)
|
||||
*/
|
||||
if (rtq_reallyold != 0) {
|
||||
rt->rt_flags |= RTPRF_OURS;
|
||||
rt->rt_rmx.rmx_expire = time_second + rtq_reallyold;
|
||||
rt->rt_rmx.rmx_expire = time_uptime + rtq_reallyold;
|
||||
} else {
|
||||
rtexpunge(rt);
|
||||
}
|
||||
@ -290,7 +290,7 @@ in6_rtqkill(struct radix_node *rn, void *rock)
|
||||
if (rt->rt_flags & RTPRF_OURS) {
|
||||
ap->found++;
|
||||
|
||||
if (ap->draining || rt->rt_rmx.rmx_expire <= time_second) {
|
||||
if (ap->draining || rt->rt_rmx.rmx_expire <= time_uptime) {
|
||||
if (rt->rt_refcnt > 0)
|
||||
panic("rtqkill route really not free");
|
||||
|
||||
@ -305,9 +305,9 @@ in6_rtqkill(struct radix_node *rn, void *rock)
|
||||
}
|
||||
} else {
|
||||
if (ap->updating
|
||||
&& (rt->rt_rmx.rmx_expire - time_second
|
||||
&& (rt->rt_rmx.rmx_expire - time_uptime
|
||||
> rtq_reallyold)) {
|
||||
rt->rt_rmx.rmx_expire = time_second
|
||||
rt->rt_rmx.rmx_expire = time_uptime
|
||||
+ rtq_reallyold;
|
||||
}
|
||||
ap->nextstop = lmin(ap->nextstop,
|
||||
@ -391,7 +391,7 @@ in6_mtuexpire(struct radix_node *rn, void *rock)
|
||||
panic("rt == NULL in in6_mtuexpire");
|
||||
|
||||
if (rt->rt_rmx.rmx_expire && !(rt->rt_flags & RTF_PROBEMTU)) {
|
||||
if (rt->rt_rmx.rmx_expire <= time_second) {
|
||||
if (rt->rt_rmx.rmx_expire <= time_uptime) {
|
||||
rt->rt_flags |= RTF_PROBEMTU;
|
||||
} else {
|
||||
ap->nextstop = lmin(ap->nextstop,
|
||||
|
Loading…
x
Reference in New Issue
Block a user