#include <string.h>
#include <isc/async.h>
+#include <isc/atomic.h>
#include <isc/counter.h>
#include <isc/hex.h>
#include <isc/list.h>
} while (0)
#define RESTORE(a, b) SAVE(a, b)
+static atomic_uint_fast32_t last_rpznotready_log = 0;
+
+static bool
+can_log_rpznotready(void) {
+ isc_stdtime_t last;
+ isc_stdtime_t now = isc_stdtime_now();
+ last = atomic_exchange_relaxed(&last_rpznotready_log, now);
+ if (now != last) {
+ return true;
+ }
+
+ return false;
+}
+
static bool
validate(ns_client_t *client, dns_db_t *db, dns_name_t *name,
dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
/* Do not pollute SERVFAIL cache */
client->inner.attributes |= NS_CLIENTATTR_NOSETFC;
- rpz_log_fail(client, DNS_RPZ_INFO_LEVEL, NULL,
- DNS_RPZ_TYPE_QNAME, "RPZ servfail-until-ready",
- DNS_R_WAIT);
+ if (can_log_rpznotready()) {
+ rpz_log_fail(client, DNS_RPZ_INFO_LEVEL, NULL,
+ DNS_RPZ_TYPE_QNAME,
+ "RPZ servfail-until-ready", DNS_R_WAIT);
+ }
+
st->m.policy = DNS_RPZ_POLICY_ERROR;
goto cleanup;
}