diff options
author | 2021-11-10 16:41:10 -0800 | |
---|---|---|
committer | 2022-06-10 18:57:33 +0200 | |
commit | 60ac45234c553737b0476783eb740f454ccc76fd (patch) | |
tree | f81a8d40fd0ea6f01319a419ee58f565d9e21cc3 | |
parent | if_wg: wg_clone_create: Use M_WAITOK with malloc (diff) | |
download | wireguard-freebsd-60ac45234c553737b0476783eb740f454ccc76fd.tar.xz wireguard-freebsd-60ac45234c553737b0476783eb740f454ccc76fd.zip |
wg_cookie: ratelimit_init: use callout_init_mtx
callout_init_rw() happens to compile ok because both are macros that
dereference the passed in lock's "lock_object" member to pass to the
real function.
Signed-off-by: John Baldwin <jhb@FreeBSD.org>
-rw-r--r-- | src/wg_cookie.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wg_cookie.c b/src/wg_cookie.c index d87bfe5..fa63832 100644 --- a/src/wg_cookie.c +++ b/src/wg_cookie.c @@ -341,7 +341,7 @@ ratelimit_init(struct ratelimit *rl) { size_t i; mtx_init(&rl->rl_mtx, "ratelimit_lock", NULL, MTX_DEF); - callout_init_rw(&rl->rl_gc, &rl->rl_mtx, 0); + callout_init_mtx(&rl->rl_gc, &rl->rl_mtx, 0); arc4random_buf(rl->rl_secret, sizeof(rl->rl_secret)); for (i = 0; i < RATELIMIT_SIZE; i++) LIST_INIT(&rl->rl_table[i]); |