Compare commits

...
11 Commits
Author SHA1 Message Date
Tony Finch 8c2d1b57c2 amend! Remove unused rbtnode->rpz flag
Remove unused rbtnode->rpz flag

The rbtnode->rpz flag was left behind when rbt and rpz were disentangled
by CHANGES #4576. Removing it makes the comment above correct again.

This reduces the flags so they fit in a 32 bit word again. On 64
bit systems there is still padding so it doesn't change the size
of an rbtnode. On 32 bit systems it reduces an rbtnode by 4 bytes.
2022-04-28 14:28:56 +01:00
Tony Finch 0d6e5783f8 amend! Clean up #include <isc/string.h>
Clean up #include <isc/string.h>

It isn't just about HP/UX any more.
2022-04-28 14:27:53 +01:00
Tony Finch 659ce8e95f Tidy up some DNS_RDATASET_FIXED conditional compilation
Add a #if to make it clear that struct xrdata->order is only used
in DNS_RDATASET_FIXED mode.

Re-order some variable declarations to merge two #if blocks into one.
2022-04-27 14:44:04 +01:00
Tony Finch e64fa8507a Clean up #include <isc/string.h>
It isn't juat about HP/UX any more.
2022-04-27 14:44:04 +01:00
Tony Finch 4f55e823d1 Ditch a couple of unused #defines
These were added by mistake in CHANGES 2349 and were not removed when
the mistake was corrected.
2022-04-27 14:44:04 +01:00
Tony Finch 4ce841d6da Use a case-sensitive hash table for ADB address entries
The key for the ADB `entrybuckets` hash table is a binary `struct
isc_sockaddr` so it seems wrong to use a case-insensitive hash.
2022-04-27 14:44:04 +01:00
Tony Finch d4e31c6b9a Reduce padding in ADB address entries
Saves a couple of bytes in `struct dns_adbentry`.
2022-04-27 14:44:04 +01:00
Tony Finch c4906ec9ff Remove remaining checks for rbt64
These checks have been redundant since the `rbtdb64` implementation
was removed in 2018 (commit 784087390a). It isn't possible to create
a zone that uses `database "rbt64"` now that the `rbt64` database
implementation has been removed, so the checks will always fail.
2022-04-27 14:44:04 +01:00
Tony Finch e79717dfd7 Remove several superfluous newlines in log messages 2022-04-27 14:44:04 +01:00
Tony Finch d961a5cb3f Clarify a few zonetree API comments
Replace a load-bearing semicolon with some more explanatory words,
and correct a couple of parameter names.
2022-04-27 14:44:04 +01:00
Tony Finch 4af41a0ac8 Remove unused rbtnode->rpz flag
The rbtnode->rpz flag was left behind when rbt and rpz were disentangled
by CHANGES #4576. Removing it makes the comment above correct again.

Although this reduces the flags to 32 bits, there is still padding
(on 64 bit systems) so it doesn't change the size of an rbtnode.
2022-04-27 14:44:00 +01:00
25 changed files with 42 additions and 62 deletions
+1 -3
View File
@@ -246,9 +246,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
* Skip checks when using an alternate data source.
*/
cfg_map_get(zoptions, "database", &dbobj);
if (dbobj != NULL && strcmp("rbt", cfg_obj_asstring(dbobj)) != 0 &&
strcmp("rbt64", cfg_obj_asstring(dbobj)) != 0)
{
if (dbobj != NULL && strcmp("rbt", cfg_obj_asstring(dbobj)) != 0) {
return (ISC_R_SUCCESS);
}
-4
View File
@@ -1779,10 +1779,6 @@ check_dbtype(dns_zone_t *zone, unsigned int dbtypec, const char **dbargv,
for (i = 0; i < dbtypec; i++) {
if (argv[i] == NULL || strcmp(argv[i], dbargv[i]) != 0) {
CHECK(ISC_R_FAILURE);
/*
* Check that there are not extra arguments.
*/
}
}
+1 -1
View File
@@ -17,7 +17,7 @@
#include <isc/buffer.h>
#include <isc/mem.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <dns/fixedname.h>
#include <dns/keyvalues.h>
+1 -1
View File
@@ -20,7 +20,7 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/stats.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/util.h>
#include <dns/acl.h>
+2 -3
View File
@@ -3738,7 +3738,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
}
/*
* If the zone type is rbt/rbt64 then primary/hint zones require file
* If the zone type is rbt then primary/hint zones require file
* clauses. If inline-signing is used, then secondary zones require a
* file clause as well.
*/
@@ -3759,8 +3759,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
result = ISC_R_FAILURE;
} else if (!dlz && (tresult == ISC_R_NOTFOUND ||
(tresult == ISC_R_SUCCESS &&
(strcmp("rbt", cfg_obj_asstring(obj)) == 0 ||
strcmp("rbt64", cfg_obj_asstring(obj)) == 0))))
strcmp("rbt", cfg_obj_asstring(obj)) == 0)))
{
isc_result_t res1;
const cfg_obj_t *fileobj = NULL;
+8 -8
View File
@@ -32,7 +32,7 @@
#include <isc/random.h>
#include <isc/result.h>
#include <isc/stats.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/task.h>
#include <isc/util.h>
@@ -232,16 +232,16 @@ struct dns_adbentry {
dns_adb_t *adb;
dns_adbentrybucket_t *bucket;
unsigned int nh;
unsigned int flags;
unsigned int srtt;
uint16_t udpsize;
unsigned int completed;
unsigned int timeouts;
unsigned char plain;
unsigned char plainto;
unsigned char edns;
unsigned char ednsto;
unsigned int nh;
uint16_t udpsize;
uint8_t mode;
atomic_uint_fast32_t quota;
@@ -881,7 +881,7 @@ link_entry(dns_adbentrybucket_t *ebucket, dns_adbentry_t *entry) {
REQUIRE(entry != NULL && entry->bucket == NULL);
REQUIRE(!ISC_LINK_LINKED(entry, plink));
DP(DEF_LEVEL, "link ADB entry %p to bucket %p\n", entry, ebucket);
DP(DEF_LEVEL, "link ADB entry %p to bucket %p", entry, ebucket);
/*
* If we're in the overmem condition, take this opportunity to
@@ -937,7 +937,7 @@ unlink_entry(dns_adbentry_t *entry) {
REQUIRE(ebucket != NULL);
DP(DEF_LEVEL, "unlink ADB entry %p from bucket %p\n", entry, ebucket);
DP(DEF_LEVEL, "unlink ADB entry %p from bucket %p", entry, ebucket);
if ((entry->flags & ENTRY_IS_DEAD) != 0) {
ISC_LIST_UNLINK(ebucket->deadentries, entry, plink);
@@ -2041,7 +2041,7 @@ destroy(dns_adb_t *adb) {
isc_result_t result;
isc_ht_iter_t *it = NULL;
DP(DEF_LEVEL, "destroying ADB %p\n", adb);
DP(DEF_LEVEL, "destroying ADB %p", adb);
adb->magic = 0;
@@ -2114,7 +2114,7 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_taskmgr_t *taskmgr,
isc_ht_init(&adb->namebuckets, adb->mctx, 1, ISC_HT_CASE_INSENSITIVE);
isc_rwlock_init(&adb->names_lock, 0, 0);
isc_ht_init(&adb->entrybuckets, adb->mctx, 1, ISC_HT_CASE_INSENSITIVE);
isc_ht_init(&adb->entrybuckets, adb->mctx, 1, ISC_HT_CASE_SENSITIVE);
isc_rwlock_init(&adb->entries_lock, 0, 0);
isc_mutex_init(&adb->lock);
@@ -2248,7 +2248,7 @@ dns_adb_shutdown(dns_adb_t *adb) {
return;
}
DP(DEF_LEVEL, "shutting down ADB %p\n", adb);
DP(DEF_LEVEL, "shutting down ADB %p", adb);
isc_mem_clearwater(adb->mctx);
+1 -1
View File
@@ -19,7 +19,7 @@
#include <isc/netaddr.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/task.h>
#include <isc/util.h>
+1 -4
View File
@@ -97,12 +97,9 @@ struct dns_rbtnode {
unsigned int namelen : 8; /*%< range is 1..255 */
unsigned int offsetlen : 8; /*%< range is 1..128 */
unsigned int oldnamelen : 8; /*%< range is 1..255 */
unsigned int : 0; /* end of bitfields c/o tree lock */
/*@}*/
/* node needs to be cleaned from rpz */
unsigned int rpz : 1;
unsigned int : 0; /* end of bitfields c/o tree lock */
/*%
* These are needed for hashing. The 'uppernode' points to the
* node's superdomain node in the parent subtree, so that it can
-6
View File
@@ -53,12 +53,6 @@ ISC_LANG_BEGINDECLS
#define DNS_RDATASLAB_EXACT 0x2
#define DNS_RDATASLAB_OFFLINE 0x01 /* RRSIG is for offline DNSKEY */
#define DNS_RDATASLAB_WARNMASK \
0x0E /*%< RRSIG(DNSKEY) expired \
* warnings number mask. */
#define DNS_RDATASLAB_WARNSHIFT \
1 /*%< How many bits to shift to find \
* remaining expired warning number. */
/***
*** Functions
+4 -4
View File
@@ -182,8 +182,8 @@ dns_zt_apply(dns_zt_t *zt, bool stop, isc_result_t *sub,
* Returns:
* \li ISC_R_SUCCESS if action was applied to all nodes. If 'stop' is
* false and 'sub' is non NULL then the first error (if any)
* reported by 'action' is returned in '*sub';
* any error code from 'action'.
* reported by 'action' is returned in '*sub'. If 'stop' is true,
* the first error code from 'action' is returned.
*/
bool
@@ -203,7 +203,7 @@ dns_zt_setviewcommit(dns_zt_t *zt);
* zone table.
*
* Requires:
*\li 'view' to be valid.
*\li 'zt' to be valid.
*/
void
@@ -213,7 +213,7 @@ dns_zt_setviewrevert(dns_zt_t *zt);
* zone table.
*
* Requires:
*\li 'view' to be valid.
*\li 'zt' to be valid.
*/
ISC_LANG_ENDDECLS
+1 -1
View File
@@ -20,7 +20,7 @@
#include <isc/refcount.h>
#include <isc/result.h>
#include <isc/rwlock.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/util.h>
#include <dns/dnssec.h>
+1 -1
View File
@@ -18,7 +18,7 @@
#include <isc/mem.h>
#include <isc/netaddr.h>
#include <isc/result.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/task.h>
#include <isc/util.h>
+1 -1
View File
@@ -25,7 +25,7 @@
#include <isc/mem.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/utf8.h>
#include <isc/util.h>
-1
View File
@@ -1513,7 +1513,6 @@ create_node(isc_mem_t *mctx, const dns_name_t *name, dns_rbtnode_t **nodep) {
node->left = NULL;
node->down = NULL;
node->data = NULL;
node->rpz = 0;
node->hashnext = NULL;
node->hashval = 0;
+2 -2
View File
@@ -34,8 +34,8 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *base, dns_dbtype_t type,
void *driverarg, dns_db_t **dbp);
/*%<
* Create a new database of type "rbt" (or "rbt64"). Called via
* dns_db_create(); see documentation for that function for more details.
* Create a new database of type "rbt". Called via dns_db_create();
* see documentation for that function for more details.
*
* If argv[0] is set, it points to a valid memory context to be used for
* allocation of heap memory. Generally this is used for cache databases
+5 -5
View File
@@ -19,7 +19,7 @@
#include <isc/mem.h>
#include <isc/region.h>
#include <isc/result.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/util.h>
#include <dns/rdata.h>
@@ -70,7 +70,9 @@
struct xrdata {
dns_rdata_t rdata;
#if DNS_RDATASET_FIXED
unsigned int order;
#endif /* if DNS_RDATASET_FIXED */
};
/*% Note: the "const void *" are just to make qsort happy. */
@@ -122,18 +124,16 @@ dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
static unsigned char removed;
struct xrdata *x;
unsigned char *rawbuf;
#if DNS_RDATASET_FIXED
unsigned char *offsetbase;
#endif /* if DNS_RDATASET_FIXED */
unsigned int buflen;
isc_result_t result;
unsigned int nitems;
unsigned int nalloc;
unsigned int length;
unsigned int i;
#if DNS_RDATASET_FIXED
unsigned char *offsetbase;
unsigned int *offsettable;
#endif /* if DNS_RDATASET_FIXED */
unsigned int length;
buflen = reservelen + 2;
+1 -1
View File
@@ -17,7 +17,7 @@
#include <isc/buffer.h>
#include <isc/result.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/util.h>
#include <dns/callbacks.h>
+1 -1
View File
@@ -23,7 +23,7 @@
#include <isc/result.h>
#include <isc/serial.h>
#include <isc/stdtime.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/util.h>
#include <dns/time.h>
+1 -1
View File
@@ -23,7 +23,7 @@
#include <isc/refcount.h>
#include <isc/result.h>
#include <isc/serial.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/time.h>
#include <isc/util.h>
+1 -1
View File
@@ -29,7 +29,7 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/stats.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/task.h>
#include <isc/util.h>
+1 -1
View File
@@ -21,7 +21,7 @@
#include <isc/print.h>
#include <isc/random.h>
#include <isc/result.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/util.h>
#include <dns/callbacks.h>
+2 -5
View File
@@ -1924,9 +1924,7 @@ dns_zone_rpz_enable(dns_zone_t *zone, dns_rpz_zones_t *rpzs,
* Only zones that are loaded instead of mmap()ed create the
* summary data and so can be policy zones.
*/
if (strcmp(zone->db_argv[0], "rbt") != 0 &&
strcmp(zone->db_argv[0], "rbt64") != 0)
{
if (strcmp(zone->db_argv[0], "rbt") != 0) {
return (ISC_R_NOTIMPLEMENTED);
}
@@ -2163,8 +2161,7 @@ zone_load(dns_zone_t *zone, unsigned int flags, bool locked) {
INSIST(zone->db_argc >= 1);
rbt = strcmp(zone->db_argv[0], "rbt") == 0 ||
strcmp(zone->db_argv[0], "rbt64") == 0;
rbt = strcmp(zone->db_argv[0], "rbt") == 0;
if (zone->db != NULL && zone->masterfile == NULL && rbt) {
/*
+4 -4
View File
@@ -2154,8 +2154,8 @@ isc__nmsocket_readtimeout_cb(uv_timer_t *timer);
void
isc__nmsocket_writetimeout_cb(void *data, isc_result_t eresult);
#define UV_RUNTIME_CHECK(func, ret) \
if (ret != 0) { \
isc_error_fatal(__FILE__, __LINE__, "%s failed: %s\n", #func, \
uv_strerror(ret)); \
#define UV_RUNTIME_CHECK(func, ret) \
if (ret != 0) { \
isc_error_fatal(__FILE__, __LINE__, "%s failed: %s", #func, \
uv_strerror(ret)); \
}
+1 -1
View File
@@ -17,7 +17,7 @@
#include <isc/mem.h>
#include <isc/print.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/string.h>
#include <isc/util.h>
#include <dns/acl.h>
+1 -1
View File
@@ -6985,7 +6985,7 @@ query_checkrrl(query_ctx_t *qctx, isc_result_t result) {
ISC_LOG_DEBUG(99),
"rrl=%p, HAVECOOKIE=%u, result=%s, "
"fname=%p(%u), is_zone=%u, RECURSIONOK=%u, "
"query.rpz_st=%p(%u), RRL_CHECKED=%u\n",
"query.rpz_st=%p(%u), RRL_CHECKED=%u",
qctx->client->view->rrl, HAVECOOKIE(qctx->client),
isc_result_toid(result), qctx->fname,
qctx->fname != NULL ? dns_name_isabsolute(qctx->fname) : 0,