summaryrefslogtreecommitdiffstats
path: root/src/wireguard.h
diff options
context:
space:
mode:
authorMatt Dunwoodie <ncon@mail.noconroy.net>2019-04-30 21:12:53 +1000
committerMatt Dunwoodie <ncon@mail.noconroy.net>2019-05-01 01:42:04 +1000
commit387ab8640e91e2a2745b96bd4ab16b20c36f15b8 (patch)
tree01a9ed5fa48a764a4e046eef7677cd32cb865763 /src/wireguard.h
parentChange is_high_cpu -> get_cookie (diff)
downloadwireguard-openbsd-387ab8640e91e2a2745b96bd4ab16b20c36f15b8.tar.xz
wireguard-openbsd-387ab8640e91e2a2745b96bd4ab16b20c36f15b8.zip
Fixup buggy timeouts
This should be a more robust, and efficient way of tracking timeouts. Instead of storing the lastsent/lastrecv time and comparing them, we have flags that get toggled when receiving these packets.
Diffstat (limited to 'src/wireguard.h')
-rw-r--r--src/wireguard.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wireguard.h b/src/wireguard.h
index 1064c9e26ae..438cbf0b555 100644
--- a/src/wireguard.h
+++ b/src/wireguard.h
@@ -88,8 +88,6 @@ struct wg_peer {
struct wg_session {
struct timespec created;
- struct timespec lastrecv;
- struct timespec lastsend;
struct wg_antireplay {
u_int64_t head;
u_int64_t bitmap[WG_ANTIREPLAY_BITMAP_BITS / WG_ANTIREPLAY_INTEGER_BITS];
@@ -103,6 +101,9 @@ struct wg_peer {
enum wg_role role;
} p_curr_sess, p_prev_sess;
+ bool p_require_keepalive, p_require_broken;
+ struct timespec p_lastrecv;
+
struct wg_cookie {
u_int8_t value [WG_COOKIE_SIZE];
struct timespec time;