diff options
author | Jan Hák <jan.hak@nic.cz> | 2024-11-26 12:56:51 +0100 |
---|---|---|
committer | Daniel Salzman <daniel.salzman@nic.cz> | 2024-12-11 17:36:20 +0100 |
commit | 424fb0bac2f5d420451e18897375765fafdc80c5 (patch) | |
tree | 53e864760bdd98732728f4b8e16d900fa78b942c | |
parent | dnssec: fix usage of new atomic in code (variable dnssec_expire) (diff) | |
download | knot-424fb0bac2f5d420451e18897375765fafdc80c5.tar.xz knot-424fb0bac2f5d420451e18897375765fafdc80c5.zip |
modules/cookies: fix usage of new atomic in code (variable badcookie_ctr)
-rw-r--r-- | src/knot/modules/cookies/cookies.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/knot/modules/cookies/cookies.c b/src/knot/modules/cookies/cookies.c index 706258bb0..de82a04b5 100644 --- a/src/knot/modules/cookies/cookies.c +++ b/src/knot/modules/cookies/cookies.c @@ -249,7 +249,7 @@ int cookies_load(knotd_mod_t *mod) } // Initialize BADCOOKIE counter. - ctx->badcookie_ctr = BADCOOKIE_CTR_INIT; + ATOMIC_INIT(ctx->badcookie_ctr, BADCOOKIE_CTR_INIT); // Set up configurable items. knotd_conf_t conf = knotd_conf_mod(mod, MOD_BADCOOKIE_SLIP); @@ -309,6 +309,7 @@ void cookies_unload(knotd_mod_t *mod) (void)pthread_cancel(ctx->update_secret); (void)pthread_join(ctx->update_secret, NULL); } + ATOMIC_DEINIT(ctx->badcookie_ctr); memzero(&ctx->secret, sizeof(ctx->secret)); free(ctx); } |