diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-10-03 12:33:22 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-10-03 12:33:22 +0000 |
commit | 2ccbc991cb3c0ab5161657b9618933487f2e78a4 (patch) | |
tree | 0a565920444959cdd6ca3b107811406e2dc5f039 /sys/netinet6/ip6_forward.c | |
parent | ae60c1c6b0fa997314e9c82471a6e0ac2a7f1ea1 (diff) |
Convert some of the remaining usages of time_second to time_uptime.
time_second is unix time so it can be affected by clock changes.
time_uptime is monotonic so it isnt affected by clock changes. that
in turn means route expiries wont jump with clock changes if set
against time_uptime.
the expiry is translated into unix time for export to userland though.
Should fix mismatch between route timers that were already converted
and ND default routers that were still using time_second.
Tested by matthieu@ and sthen@
ok sthen@, dlg@
Diffstat (limited to 'sys/netinet6/ip6_forward.c')
-rw-r--r-- | sys/netinet6/ip6_forward.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index 09e7ac29dbe..9d9bfdccc97 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_forward.c,v 1.92 2016/08/24 09:41:12 mpi Exp $ */ +/* $OpenBSD: ip6_forward.c,v 1.93 2016/10/03 12:33:21 mpi Exp $ */ /* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */ /* @@ -104,8 +104,8 @@ ip6_forward(struct mbuf *m, struct rtentry *rt, int srcrt) IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) || IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { ip6stat.ip6s_cantforward++; - if (ip6_log_time + ip6_log_interval < time_second) { - ip6_log_time = time_second; + if (ip6_log_time + ip6_log_interval < time_uptime) { + ip6_log_time = time_uptime; inet_ntop(AF_INET6, &ip6->ip6_src, src6, sizeof(src6)); inet_ntop(AF_INET6, &ip6->ip6_dst, dst6, sizeof(dst6)); log(LOG_DEBUG, @@ -193,8 +193,8 @@ reroute: ip6stat.ip6s_cantforward++; ip6stat.ip6s_badscope++; - if (ip6_log_time + ip6_log_interval < time_second) { - ip6_log_time = time_second; + if (ip6_log_time + ip6_log_interval < time_uptime) { + ip6_log_time = time_uptime; inet_ntop(AF_INET6, &ip6->ip6_src, src6, sizeof(src6)); inet_ntop(AF_INET6, &ip6->ip6_dst, dst6, sizeof(dst6)); log(LOG_DEBUG, |