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 | 8644566cc42d7ee03fcb547bdc44eb798ec7e55a (patch) | |
tree | f75e7696bbf1ae2d51bcd5c6243e60599987ae92 | |
parent | modules/cookies: fix usage of new atomic in code (variable badcookie_ctr) (diff) | |
download | knot-8644566cc42d7ee03fcb547bdc44eb798ec7e55a.tar.xz knot-8644566cc42d7ee03fcb547bdc44eb798ec7e55a.zip |
modules/probe: fix usage of new atomic in code (variable last_times)
-rw-r--r-- | src/knot/modules/probe/probe.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/knot/modules/probe/probe.c b/src/knot/modules/probe/probe.c index 3e0a646b5..f9eb177ac 100644 --- a/src/knot/modules/probe/probe.c +++ b/src/knot/modules/probe/probe.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz> +/* Copyright (C) 2024 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -47,6 +47,7 @@ static void free_probe_ctx(probe_ctx_t *ctx) { for (int i = 0; ctx->probes != NULL && i < ctx->probe_count; ++i) { knot_probe_free(ctx->probes[i]); + ATOMIC_DEINIT(ctx->last_times[i]); } free(ctx->probes); free(ctx->last_times); @@ -137,6 +138,9 @@ int probe_load(knotd_mod_t *mod) free_probe_ctx(ctx); return KNOT_ENOMEM; } + for (int i = 0; i < ctx->probe_count; i++) { + ATOMIC_INIT(ctx->last_times[i], 0); + } ctx->min_diff_ns = 0; conf = knotd_conf_mod(mod, MOD_MAX_RATE); |