mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Merge branch '3975-atomically-increase-rrn-in-add-other-data' into 'main'
atomically increase rrn in add_other_data Closes #3975 See merge request isc-projects/bind9!7824
This commit is contained in:
commit
eb2c8ab213
1 changed files with 3 additions and 2 deletions
|
|
@ -37,6 +37,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <isc/atomic.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include "test-data.h"
|
||||
|
|
@ -392,13 +393,13 @@ add_other_rr(trpz_result_t *node, const char *rrtype, const char *val,
|
|||
uint32_t ttl, int *modified) {
|
||||
trpz_rr_t nrec = { 0 };
|
||||
size_t n;
|
||||
static unsigned int rrn = 1;
|
||||
static atomic_uint_fast32_t rrn = 1;
|
||||
|
||||
*modified = 0;
|
||||
|
||||
nrec.class = ns_c_in;
|
||||
nrec.ttl = ttl;
|
||||
nrec.rrn = rrn++;
|
||||
nrec.rrn = atomic_fetch_add_relaxed(&rrn, 1);
|
||||
|
||||
if (!strcasecmp(rrtype, "A")) {
|
||||
uint32_t addr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue