fixed too delayed routing cache expiry. (tvtohz() converts a time interval to ticks, whereas hzto() converts an absolute time to ticks)

Obtained from: KAME
This commit is contained in:
suz 2004-10-06 03:32:26 +00:00
parent 588f4ee00b
commit 88453bf9b4

View File

@ -367,7 +367,7 @@ in6_rtqtimo(void *rock)
}
atv.tv_usec = 0;
atv.tv_sec = arg.nextstop;
atv.tv_sec = arg.nextstop - time_second;
callout_reset(&rtq_timer, tvtohz(&atv), in6_rtqtimo, rock);
}
@ -418,10 +418,10 @@ in6_mtutimo(void *rock)
RADIX_NODE_HEAD_UNLOCK(rnh);
atv.tv_usec = 0;
atv.tv_sec = arg.nextstop;
if (atv.tv_sec < time_second) {
atv.tv_sec = arg.nextstop - time_second;
if (atv.tv_sec < 0) {
printf("invalid mtu expiration time on routing table\n");
arg.nextstop = time_second + 30; /* last resort */
arg.nextstop = 30; /* last resort */
}
callout_reset(&rtq_mtutimer, tvtohz(&atv), in6_mtutimo, rock);
}