diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-06-12 15:05:50 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-06-25 16:42:42 +0200 |
commit | 868bdd798190a689ddebf1fff7c41509e73c7cc0 (patch) | |
tree | eda7b6e3f06ea2e5ae20c175944a433231681b4c /src/peer.c | |
parent | 07b71d592d4c172f3311e91a36b65e98cae68198 (diff) |
global: switch to coarse ktime
Coarse ktime is broken until [1] in 5.2 and kernels without the
backport, so we use fallback code there.
The fallback code has also been improved significantly. It now only uses
slower clocks on kernels < 3.17, at the expense of some accuracy we're
not overly concerned about.
[1] https://lore.kernel.org/lkml/tip-e3ff9c3678b4d80e22d2557b68726174578eaf52@git.kernel.org/
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/peer.c')
-rw-r--r-- | src/peer.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -57,7 +57,7 @@ struct wg_peer *wg_peer_create(struct wg_device *wg, kref_init(&peer->refcount); skb_queue_head_init(&peer->staged_packet_queue); atomic64_set(&peer->last_sent_handshake, - ktime_get_boot_fast_ns() - + ktime_get_coarse_boottime_ns() - (u64)(REKEY_TIMEOUT + 1) * NSEC_PER_SEC); set_bit(NAPI_STATE_NO_BUSY_POLL, &peer->napi.state); netif_napi_add(wg->dev, &peer->napi, wg_packet_rx_poll, |