summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6.h
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2016-10-03 12:33:21 +0000
committermpi <mpi@openbsd.org>2016-10-03 12:33:21 +0000
commit56b4879e2c4b58f65e9f438345d9a3980f1be164 (patch)
tree02197b147b92d6e686d0d42b654a0d5b37fc2747 /sys/netinet6/in6.h
parentFix a possible bug that will happen with dup2() when oldd == newd. In that (diff)
downloadwireguard-openbsd-56b4879e2c4b58f65e9f438345d9a3980f1be164.tar.xz
wireguard-openbsd-56b4879e2c4b58f65e9f438345d9a3980f1be164.zip
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/in6.h')
-rw-r--r--sys/netinet6/in6.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index 8ba57fecae5..524e836c43e 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.h,v 1.90 2016/06/27 16:33:48 jca Exp $ */
+/* $OpenBSD: in6.h,v 1.91 2016/10/03 12:33:21 mpi Exp $ */
/* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */
/*
@@ -280,11 +280,11 @@ struct route_in6 {
#define IFA6_IS_DEPRECATED(a) \
((a)->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME && \
- (u_int32_t)((time_second - (a)->ia6_updatetime)) > \
+ (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \
(a)->ia6_lifetime.ia6t_pltime)
#define IFA6_IS_INVALID(a) \
((a)->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME && \
- (u_int32_t)((time_second - (a)->ia6_updatetime)) > \
+ (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \
(a)->ia6_lifetime.ia6t_vltime)
#endif /* _KERNEL */