summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Hák <jan.hak@nic.cz>2024-11-26 12:56:51 +0100
committerDaniel Salzman <daniel.salzman@nic.cz>2024-12-11 17:36:20 +0100
commit424fb0bac2f5d420451e18897375765fafdc80c5 (patch)
tree53e864760bdd98732728f4b8e16d900fa78b942c
parentdnssec: fix usage of new atomic in code (variable dnssec_expire) (diff)
downloadknot-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.c3
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);
}