diff options
author | 2016-06-03 02:56:59 +0000 | |
---|---|---|
committer | 2016-06-03 02:56:59 +0000 | |
commit | bc0ee9211197048442b4442ce8998bcebf1928e8 (patch) | |
tree | 7350778044dcb4f27719ce144e54e945712bc7aa /sys/net/route.c | |
parent | update default value for reboot (diff) | |
download | wireguard-openbsd-bc0ee9211197048442b4442ce8998bcebf1928e8.tar.xz wireguard-openbsd-bc0ee9211197048442b4442ce8998bcebf1928e8.zip |
set rt_expire times against time_uptime, not time_second.
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.
ok mpi@
Diffstat (limited to 'sys/net/route.c')
-rw-r--r-- | sys/net/route.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index 38286b8f605..a23f8702311 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.303 2016/06/01 06:40:27 dlg Exp $ */ +/* $OpenBSD: route.c,v 1.304 2016/06/03 02:56:59 dlg Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -1186,7 +1186,7 @@ rt_checkgate(struct rtentry *rt, struct rtentry **rtp) } if (rt->rt_flags & RTF_REJECT) - if (rt->rt_expire == 0 || time_second < rt->rt_expire) + if (rt->rt_expire == 0 || time_uptime < rt->rt_expire) return (rt == rt0 ? EHOSTDOWN : EHOSTUNREACH); *rtp = rt; @@ -1541,7 +1541,7 @@ rt_timer_add(struct rtentry *rt, void (*func)(struct rtentry *, long current_time; current_time = time_uptime; - rt->rt_rmx.rmx_expire = time_second + queue->rtq_timeout; + rt->rt_rmx.rmx_expire = time_uptime + queue->rtq_timeout; /* * If there's already a timer with this action, destroy it before |