aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Dunwoodie <ncon@noconroy.net>2020-02-26 23:43:56 +1100
committerMatt Dunwoodie <ncon@noconroy.net>2020-02-26 23:43:56 +1100
commit0ec42bb21113b7ef286b529c919f54b85786b181 (patch)
tree8baa7db49c0acb62cc77f88ad325017668bd5936
parentUse getnanouptime where possible (diff)
downloadwireguard-openbsd-0ec42bb21113b7ef286b529c919f54b85786b181.tar.xz
wireguard-openbsd-0ec42bb21113b7ef286b529c919f54b85786b181.zip
We want to stay under load while the timer HASN'T expired
-rw-r--r--src/if_wg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/if_wg.c b/src/if_wg.c
index 1958eb9..e37ca90 100644
--- a/src/if_wg.c
+++ b/src/if_wg.c
@@ -1416,7 +1416,7 @@ wg_handshake_in(struct wg_softc *sc, struct mbuf *m)
getnanouptime(&wg_last_underload);
underload = 1;
} else if (wg_last_underload.tv_sec != 0) {
- if (wg_timer_expired(&wg_last_underload, UNDER_LOAD_TIMEOUT, 0))
+ if (!wg_timer_expired(&wg_last_underload, UNDER_LOAD_TIMEOUT, 0))
underload = 1;
else
bzero(&wg_last_underload, sizeof(wg_last_underload));