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:
parent
7196782c5d
commit
60ac45234c
|
@ -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]);
|
||||
|
|
Loading…
Reference in New Issue