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>
This commit is contained in:
John Baldwin 2021-11-10 16:41:10 -08:00 committed by Jason A. Donenfeld
parent 7196782c5d
commit 60ac45234c
1 changed files with 1 additions and 1 deletions

View File

@ -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]);