diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 16:41:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 16:41:28 +0000 |
commit | 14509ce60103dab695cef4d4f31321bab27ab967 (patch) | |
tree | 5959cfb9832b3af242a1ca45d4a1227acae67d87 /lib/isc | |
parent | Adding debian version 1:9.18.19-1~deb12u1. (diff) | |
download | bind9-14509ce60103dab695cef4d4f31321bab27ab967.tar.xz bind9-14509ce60103dab695cef4d4f31321bab27ab967.zip |
Merging upstream version 1:9.18.24.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | lib/isc/Makefile.in | 2 | ||||
-rw-r--r-- | lib/isc/hmac.c | 65 | ||||
-rw-r--r-- | lib/isc/ht.c | 55 | ||||
-rw-r--r-- | lib/isc/httpd.c | 6 | ||||
-rw-r--r-- | lib/isc/include/isc/endian.h | 34 | ||||
-rw-r--r-- | lib/isc/include/isc/net.h | 4 | ||||
-rw-r--r-- | lib/isc/include/isc/netmgr.h | 3 | ||||
-rw-r--r-- | lib/isc/include/isc/radix.h | 2 | ||||
-rw-r--r-- | lib/isc/include/isc/types.h | 10 | ||||
-rw-r--r-- | lib/isc/mem.c | 11 | ||||
-rw-r--r-- | lib/isc/mem_p.h | 11 | ||||
-rw-r--r-- | lib/isc/netaddr.c | 2 | ||||
-rw-r--r-- | lib/isc/netmgr/http.c | 19 | ||||
-rw-r--r-- | lib/isc/netmgr/netmgr-int.h | 1 | ||||
-rw-r--r-- | lib/isc/netmgr/netmgr.c | 38 | ||||
-rw-r--r-- | lib/isc/netmgr/tcp.c | 6 | ||||
-rw-r--r-- | lib/isc/netmgr/tcpdns.c | 11 | ||||
-rw-r--r-- | lib/isc/netmgr/tlsdns.c | 11 | ||||
-rw-r--r-- | lib/isc/netmgr/tlsstream.c | 12 | ||||
-rw-r--r-- | lib/isc/netmgr/udp.c | 10 | ||||
-rw-r--r-- | lib/isc/netmgr/uv-compat.h | 2 | ||||
-rw-r--r-- | lib/isc/stats.c | 25 | ||||
-rw-r--r-- | lib/isc/trampoline.c | 5 | ||||
-rw-r--r-- | lib/isc/url.c | 5 | ||||
-rw-r--r-- | lib/isccc/Makefile.in | 2 | ||||
-rw-r--r-- | lib/isccc/cc.c | 18 | ||||
-rw-r--r-- | lib/isccfg/Makefile.in | 2 | ||||
-rw-r--r-- | lib/isccfg/namedconf.c | 9 |
28 files changed, 246 insertions, 135 deletions
diff --git a/lib/isc/Makefile.in b/lib/isc/Makefile.in index 50ec06e..8b8d16b 100644 --- a/lib/isc/Makefile.in +++ b/lib/isc/Makefile.in @@ -132,11 +132,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_jemalloc.m4 \ $(top_srcdir)/m4/ax_lib_lmdb.m4 \ - $(top_srcdir)/m4/ax_perl_module.m4 \ $(top_srcdir)/m4/ax_posix_shell.m4 \ $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ - $(top_srcdir)/m4/ax_python_module.m4 \ $(top_srcdir)/m4/ax_restore_flags.m4 \ $(top_srcdir)/m4/ax_save_flags.m4 $(top_srcdir)/m4/ax_tls.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ diff --git a/lib/isc/hmac.c b/lib/isc/hmac.c index bc35bef..4bce2c8 100644 --- a/lib/isc/hmac.c +++ b/lib/isc/hmac.c @@ -27,26 +27,26 @@ isc_hmac_t * isc_hmac_new(void) { - EVP_MD_CTX *hmac = EVP_MD_CTX_new(); - RUNTIME_CHECK(hmac != NULL); - return ((isc_hmac_t *)hmac); + EVP_MD_CTX *hmac_st = EVP_MD_CTX_new(); + RUNTIME_CHECK(hmac_st != NULL); + return ((isc_hmac_t *)hmac_st); } void -isc_hmac_free(isc_hmac_t *hmac) { - if (hmac == NULL) { +isc_hmac_free(isc_hmac_t *hmac_st) { + if (hmac_st == NULL) { return; } - EVP_MD_CTX_free((EVP_MD_CTX *)hmac); + EVP_MD_CTX_free((EVP_MD_CTX *)hmac_st); } isc_result_t -isc_hmac_init(isc_hmac_t *hmac, const void *key, const size_t keylen, +isc_hmac_init(isc_hmac_t *hmac_st, const void *key, const size_t keylen, const isc_md_type_t *md_type) { EVP_PKEY *pkey; - REQUIRE(hmac != NULL); + REQUIRE(hmac_st != NULL); REQUIRE(key != NULL); REQUIRE(keylen <= INT_MAX); @@ -60,7 +60,7 @@ isc_hmac_init(isc_hmac_t *hmac, const void *key, const size_t keylen, return (ISC_R_CRYPTOFAILURE); } - if (EVP_DigestSignInit(hmac, NULL, md_type, NULL, pkey) != 1) { + if (EVP_DigestSignInit(hmac_st, NULL, md_type, NULL, pkey) != 1) { EVP_PKEY_free(pkey); ERR_clear_error(); return (ISC_R_CRYPTOFAILURE); @@ -72,10 +72,10 @@ isc_hmac_init(isc_hmac_t *hmac, const void *key, const size_t keylen, } isc_result_t -isc_hmac_reset(isc_hmac_t *hmac) { - REQUIRE(hmac != NULL); +isc_hmac_reset(isc_hmac_t *hmac_st) { + REQUIRE(hmac_st != NULL); - if (EVP_MD_CTX_reset(hmac) != 1) { + if (EVP_MD_CTX_reset(hmac_st) != 1) { ERR_clear_error(); return (ISC_R_CRYPTOFAILURE); } @@ -84,14 +84,15 @@ isc_hmac_reset(isc_hmac_t *hmac) { } isc_result_t -isc_hmac_update(isc_hmac_t *hmac, const unsigned char *buf, const size_t len) { - REQUIRE(hmac != NULL); +isc_hmac_update(isc_hmac_t *hmac_st, const unsigned char *buf, + const size_t len) { + REQUIRE(hmac_st != NULL); if (buf == NULL || len == 0) { return (ISC_R_SUCCESS); } - if (EVP_DigestSignUpdate(hmac, buf, len) != 1) { + if (EVP_DigestSignUpdate(hmac_st, buf, len) != 1) { ERR_clear_error(); return (ISC_R_CRYPTOFAILURE); } @@ -100,15 +101,15 @@ isc_hmac_update(isc_hmac_t *hmac, const unsigned char *buf, const size_t len) { } isc_result_t -isc_hmac_final(isc_hmac_t *hmac, unsigned char *digest, +isc_hmac_final(isc_hmac_t *hmac_st, unsigned char *digest, unsigned int *digestlen) { - REQUIRE(hmac != NULL); + REQUIRE(hmac_st != NULL); REQUIRE(digest != NULL); REQUIRE(digestlen != NULL); size_t len = *digestlen; - if (EVP_DigestSignFinal(hmac, digest, &len) != 1) { + if (EVP_DigestSignFinal(hmac_st, digest, &len) != 1) { ERR_clear_error(); return (ISC_R_CRYPTOFAILURE); } @@ -119,24 +120,24 @@ isc_hmac_final(isc_hmac_t *hmac, unsigned char *digest, } const isc_md_type_t * -isc_hmac_get_md_type(isc_hmac_t *hmac) { - REQUIRE(hmac != NULL); +isc_hmac_get_md_type(isc_hmac_t *hmac_st) { + REQUIRE(hmac_st != NULL); - return (EVP_MD_CTX_get0_md(hmac)); + return (EVP_MD_CTX_get0_md(hmac_st)); } size_t -isc_hmac_get_size(isc_hmac_t *hmac) { - REQUIRE(hmac != NULL); +isc_hmac_get_size(isc_hmac_t *hmac_st) { + REQUIRE(hmac_st != NULL); - return ((size_t)EVP_MD_CTX_size(hmac)); + return ((size_t)EVP_MD_CTX_size(hmac_st)); } int -isc_hmac_get_block_size(isc_hmac_t *hmac) { - REQUIRE(hmac != NULL); +isc_hmac_get_block_size(isc_hmac_t *hmac_st) { + REQUIRE(hmac_st != NULL); - return (EVP_MD_CTX_block_size(hmac)); + return (EVP_MD_CTX_block_size(hmac_st)); } isc_result_t @@ -144,24 +145,24 @@ isc_hmac(const isc_md_type_t *type, const void *key, const size_t keylen, const unsigned char *buf, const size_t len, unsigned char *digest, unsigned int *digestlen) { isc_result_t res; - isc_hmac_t *hmac = isc_hmac_new(); + isc_hmac_t *hmac_st = isc_hmac_new(); - res = isc_hmac_init(hmac, key, keylen, type); + res = isc_hmac_init(hmac_st, key, keylen, type); if (res != ISC_R_SUCCESS) { goto end; } - res = isc_hmac_update(hmac, buf, len); + res = isc_hmac_update(hmac_st, buf, len); if (res != ISC_R_SUCCESS) { goto end; } - res = isc_hmac_final(hmac, digest, digestlen); + res = isc_hmac_final(hmac_st, digest, digestlen); if (res != ISC_R_SUCCESS) { goto end; } end: - isc_hmac_free(hmac); + isc_hmac_free(hmac_st); return (res); } diff --git a/lib/isc/ht.c b/lib/isc/ht.c index eaf2b3c..e11050f 100644 --- a/lib/isc/ht.c +++ b/lib/isc/ht.c @@ -93,11 +93,54 @@ maybe_rehash(isc_ht_t *ht, size_t newcount); static isc_result_t isc__ht_iter_next(isc_ht_iter_t *it); +static uint8_t maptolower[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, + 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, + 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, + 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, + 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, + 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, + 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, + 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, + 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, + 0xfc, 0xfd, 0xfe, 0xff +}; + +static int +memcasecmp(const void *vs1, const void *vs2, size_t len) { + uint8_t const *s1 = vs1; + uint8_t const *s2 = vs2; + for (size_t i = 0; i < len; i++) { + uint8_t u1 = s1[i]; + uint8_t u2 = s2[i]; + int U1 = maptolower[u1]; + int U2 = maptolower[u2]; + int diff = U1 - U2; + if (diff) { + return diff; + } + } + return 0; +} + static bool isc__ht_node_match(isc_ht_node_t *node, const uint32_t hashval, - const uint8_t *key, uint32_t keysize) { + const uint8_t *key, uint32_t keysize, bool case_sensitive) { return (node->hashval == hashval && node->keysize == keysize && - memcmp(node->key, key, keysize) == 0); + (case_sensitive ? (memcmp(node->key, key, keysize) == 0) + : (memcasecmp(node->key, key, keysize) == 0))); } static uint32_t @@ -341,7 +384,9 @@ nexttable: for (isc_ht_node_t *node = ht->table[findex][hash]; node != NULL; node = node->next) { - if (isc__ht_node_match(node, hashval, key, keysize)) { + if (isc__ht_node_match(node, hashval, key, keysize, + ht->case_sensitive)) + { return (node); } } @@ -390,7 +435,9 @@ isc__ht_delete(isc_ht_t *ht, const unsigned char *key, const uint32_t keysize, for (isc_ht_node_t *node = ht->table[idx][hash]; node != NULL; prev = node, node = node->next) { - if (isc__ht_node_match(node, hashval, key, keysize)) { + if (isc__ht_node_match(node, hashval, key, keysize, + ht->case_sensitive)) + { if (prev == NULL) { ht->table[idx][hash] = node->next; } else { diff --git a/lib/isc/httpd.c b/lib/isc/httpd.c index b15cc45..a93f9e1 100644 --- a/lib/isc/httpd.c +++ b/lib/isc/httpd.c @@ -340,8 +340,10 @@ value_match(const struct phr_header *header, const char *match) { limit = header->value_len - match_len + 1; for (size_t i = 0; i < limit; i++) { - if (isspace(header->value[i])) { - while (i < limit && isspace(header->value[i])) { + if (isspace((unsigned char)header->value[i])) { + while (i < limit && + isspace((unsigned char)header->value[i])) + { i++; } continue; diff --git a/lib/isc/include/isc/endian.h b/lib/isc/include/isc/endian.h index be91b1d..2590415 100644 --- a/lib/isc/include/isc/endian.h +++ b/lib/isc/include/isc/endian.h @@ -86,29 +86,29 @@ #include <inttypes.h> #ifndef bswap_16 -#define bswap_16(x) \ - ((uint16_t)((((uint16_t)(x)&0xff00) >> 8) | \ - (((uint16_t)(x)&0x00ff) << 8))) +#define bswap_16(x) \ + ((uint16_t)((((uint16_t)(x) & 0xff00) >> 8) | \ + (((uint16_t)(x) & 0x00ff) << 8))) #endif /* !bswap_16 */ #ifndef bswap_32 -#define bswap_32(x) \ - ((uint32_t)((((uint32_t)(x)&0xff000000) >> 24) | \ - (((uint32_t)(x)&0x00ff0000) >> 8) | \ - (((uint32_t)(x)&0x0000ff00) << 8) | \ - (((uint32_t)(x)&0x000000ff) << 24))) +#define bswap_32(x) \ + ((uint32_t)((((uint32_t)(x) & 0xff000000) >> 24) | \ + (((uint32_t)(x) & 0x00ff0000) >> 8) | \ + (((uint32_t)(x) & 0x0000ff00) << 8) | \ + (((uint32_t)(x) & 0x000000ff) << 24))) #endif /* !bswap_32 */ #ifndef bswap_64 -#define bswap_64(x) \ - ((uint64_t)((((uint64_t)(x)&0xff00000000000000ULL) >> 56) | \ - (((uint64_t)(x)&0x00ff000000000000ULL) >> 40) | \ - (((uint64_t)(x)&0x0000ff0000000000ULL) >> 24) | \ - (((uint64_t)(x)&0x000000ff00000000ULL) >> 8) | \ - (((uint64_t)(x)&0x00000000ff000000ULL) << 8) | \ - (((uint64_t)(x)&0x0000000000ff0000ULL) << 24) | \ - (((uint64_t)(x)&0x000000000000ff00ULL) << 40) | \ - (((uint64_t)(x)&0x00000000000000ffULL) << 56))) +#define bswap_64(x) \ + ((uint64_t)((((uint64_t)(x) & 0xff00000000000000ULL) >> 56) | \ + (((uint64_t)(x) & 0x00ff000000000000ULL) >> 40) | \ + (((uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) | \ + (((uint64_t)(x) & 0x000000ff00000000ULL) >> 8) | \ + (((uint64_t)(x) & 0x00000000ff000000ULL) << 8) | \ + (((uint64_t)(x) & 0x0000000000ff0000ULL) << 24) | \ + (((uint64_t)(x) & 0x000000000000ff00ULL) << 40) | \ + (((uint64_t)(x) & 0x00000000000000ffULL) << 56))) #endif /* !bswap_64 */ #ifndef htobe16 diff --git a/lib/isc/include/isc/net.h b/lib/isc/include/isc/net.h index 1a3ce63..077f66e 100644 --- a/lib/isc/include/isc/net.h +++ b/lib/isc/include/isc/net.h @@ -192,10 +192,10 @@ /*% Is IP address multicast? */ #define ISC_IPADDR_ISMULTICAST(i) \ - (((uint32_t)(i)&ISC__IPADDR(0xf0000000)) == ISC__IPADDR(0xe0000000)) + (((uint32_t)(i) & ISC__IPADDR(0xf0000000)) == ISC__IPADDR(0xe0000000)) #define ISC_IPADDR_ISEXPERIMENTAL(i) \ - (((uint32_t)(i)&ISC__IPADDR(0xf0000000)) == ISC__IPADDR(0xf0000000)) + (((uint32_t)(i) & ISC__IPADDR(0xf0000000)) == ISC__IPADDR(0xf0000000)) /*** *** Functions. diff --git a/lib/isc/include/isc/netmgr.h b/lib/isc/include/isc/netmgr.h index eff33f6..d42cfe9 100644 --- a/lib/isc/include/isc/netmgr.h +++ b/lib/isc/include/isc/netmgr.h @@ -750,6 +750,9 @@ isc_nm_verify_tls_peer_result_string(const isc_nmhandle_t *handle); * \li 'handle' is a valid netmgr handle object. */ +#define ISC_NM_TASK_SLOW_OFFSET -2 +#define ISC_NM_TASK_SLOW(i) (ISC_NM_TASK_SLOW_OFFSET - 1 - i) + void isc_nm_task_enqueue(isc_nm_t *mgr, isc_task_t *task, int threadid); /*%< diff --git a/lib/isc/include/isc/radix.h b/lib/isc/include/isc/radix.h index 9a91118..b385e12 100644 --- a/lib/isc/include/isc/radix.h +++ b/lib/isc/include/isc/radix.h @@ -192,7 +192,7 @@ isc_radix_process(isc_radix_tree_t *radix, isc_radix_processfunc_t func); */ #define RADIX_MAXBITS 128 -#define RADIX_NBIT(x) (0x80 >> ((x)&0x7f)) +#define RADIX_NBIT(x) (0x80 >> ((x) & 0x7f)) #define RADIX_NBYTE(x) ((x) >> 3) #define RADIX_WALK(Xhead, Xnode) \ diff --git a/lib/isc/include/isc/types.h b/lib/isc/include/isc/types.h index 7e0fc02..dc76a87 100644 --- a/lib/isc/include/isc/types.h +++ b/lib/isc/include/isc/types.h @@ -13,6 +13,7 @@ #pragma once +#include <isc/atomic.h> #include <isc/result.h> /*! \file isc/types.h @@ -74,10 +75,11 @@ typedef struct isc_rwlock isc_rwlock_t; /*%< Read Write Lock */ typedef struct isc_sockaddr isc_sockaddr_t; /*%< Socket Address */ typedef ISC_LIST(isc_sockaddr_t) isc_sockaddrlist_t; /*%< Socket Address List * */ -typedef struct isc_stats isc_stats_t; /*%< Statistics */ -typedef int_fast64_t isc_statscounter_t; -typedef struct isc_symtab isc_symtab_t; /*%< Symbol Table */ -typedef struct isc_task isc_task_t; /*%< Task */ +typedef struct isc_stats isc_stats_t; /*%< Statistics */ +typedef int_fast64_t isc_statscounter_t; +typedef atomic_int_fast64_t isc_atomic_statscounter_t; +typedef struct isc_symtab isc_symtab_t; /*%< Symbol Table */ +typedef struct isc_task isc_task_t; /*%< Task */ typedef ISC_LIST(isc_task_t) isc_tasklist_t; /*%< Task List */ typedef struct isc_taskmgr isc_taskmgr_t; /*%< Task Manager */ typedef struct isc_textregion isc_textregion_t; /*%< Text Region */ diff --git a/lib/isc/mem.c b/lib/isc/mem.c index 61a66f6..6560833 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -1906,3 +1906,14 @@ isc__mem_printactive(isc_mem_t *ctx, FILE *file) { UNUSED(file); #endif /* if ISC_MEM_TRACKLINES */ } + +void * +isc__mem_alloc_noctx(size_t size) { + return mallocx(size, 0); +} + +void +isc__mem_free_noctx(void *ptr, size_t size) { + ADJUST_ZERO_ALLOCATION_SIZE(size); + sdallocx(ptr, size, 0); +} diff --git a/lib/isc/mem_p.h b/lib/isc/mem_p.h index 611a025..d95bfc3 100644 --- a/lib/isc/mem_p.h +++ b/lib/isc/mem_p.h @@ -26,6 +26,17 @@ isc__mem_printactive(isc_mem_t *mctx, FILE *file); * a single memory context. */ +void * +isc__mem_alloc_noctx(size_t size); +void +isc__mem_free_noctx(void *ptr, size_t size); +/*%< + * Allocate memory that is not associated with an isc_mem memory context. + * + * For use purely in the isc_trampoline unit, to avoid the need of copying + * multiple #ifdef lines from lib/isc/mem.c to lib/isc/trampoline.c. + */ + void isc__mem_checkdestroyed(void); diff --git a/lib/isc/netaddr.c b/lib/isc/netaddr.c index c674d83..a170d2f 100644 --- a/lib/isc/netaddr.c +++ b/lib/isc/netaddr.c @@ -424,7 +424,7 @@ isc_netaddr_issitelocal(const isc_netaddr_t *na) { } #define ISC_IPADDR_ISNETZERO(i) \ - (((uint32_t)(i)&ISC__IPADDR(0xff000000)) == ISC__IPADDR(0x00000000)) + (((uint32_t)(i) & ISC__IPADDR(0xff000000)) == ISC__IPADDR(0x00000000)) bool isc_netaddr_isnetzero(const isc_netaddr_t *na) { diff --git a/lib/isc/netmgr/http.c b/lib/isc/netmgr/http.c index f2d3e2d..2220edf 100644 --- a/lib/isc/netmgr/http.c +++ b/lib/isc/netmgr/http.c @@ -2493,6 +2493,7 @@ isc_nm_listenhttp(isc_nm_t *mgr, isc_sockaddr_t *iface, int backlog, isc_nmsocket_t *sock = NULL; isc_result_t result; + REQUIRE(VALID_NM(mgr)); REQUIRE(!ISC_LIST_EMPTY(eps->handlers)); REQUIRE(!ISC_LIST_EMPTY(eps->handler_cbargs)); REQUIRE(atomic_load(&eps->in_use) == false); @@ -2968,7 +2969,7 @@ isc__nm_http_set_max_streams(isc_nmsocket_t *listener, void isc_nm_http_set_endpoints(isc_nmsocket_t *listener, isc_nm_http_endpoints_t *eps) { - size_t nworkers; + size_t nlisteners; REQUIRE(VALID_NMSOCK(listener)); REQUIRE(listener->type == isc_nm_httplistener); @@ -2976,8 +2977,8 @@ isc_nm_http_set_endpoints(isc_nmsocket_t *listener, atomic_store(&eps->in_use, true); - nworkers = (size_t)listener->mgr->nworkers; - for (size_t i = 0; i < nworkers; i++) { + nlisteners = (size_t)listener->mgr->nlisteners; + for (size_t i = 0; i < nlisteners; i++) { isc__netievent__http_eps_t *ievent = isc__nm_get_netievent_httpendpoints(listener->mgr, listener, eps); @@ -3002,20 +3003,20 @@ isc__nm_async_httpendpoints(isc__networker_t *worker, isc__netievent_t *ev0) { static void http_init_listener_endpoints(isc_nmsocket_t *listener, isc_nm_http_endpoints_t *epset) { - size_t nworkers; + size_t nlisteners; REQUIRE(VALID_NMSOCK(listener)); REQUIRE(VALID_NM(listener->mgr)); REQUIRE(VALID_HTTP_ENDPOINTS(epset)); - nworkers = (size_t)listener->mgr->nworkers; - INSIST(nworkers > 0); + nlisteners = (size_t)listener->mgr->nlisteners; + INSIST(nlisteners > 0); listener->h2.listener_endpoints = isc_mem_get(listener->mgr->mctx, - sizeof(isc_nm_http_endpoints_t *) * nworkers); - listener->h2.n_listener_endpoints = nworkers; - for (size_t i = 0; i < nworkers; i++) { + sizeof(isc_nm_http_endpoints_t *) * nlisteners); + listener->h2.n_listener_endpoints = nlisteners; + for (size_t i = 0; i < nlisteners; i++) { listener->h2.listener_endpoints[i] = NULL; isc_nm_http_endpoints_attach( epset, &listener->h2.listener_endpoints[i]); diff --git a/lib/isc/netmgr/netmgr-int.h b/lib/isc/netmgr/netmgr-int.h index 364a933..6aca9ab 100644 --- a/lib/isc/netmgr/netmgr-int.h +++ b/lib/isc/netmgr/netmgr-int.h @@ -776,6 +776,7 @@ struct isc_nm { isc_refcount_t references; isc_mem_t *mctx; int nworkers; + int nlisteners; isc_mutex_t lock; isc_condition_t wkstatecond; isc_condition_t wkpausecond; diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index b19d468..2310b4b 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -189,12 +189,12 @@ isc__nm_force_tid(int tid) { } static void -isc__nm_threadpool_initialize(uint32_t workers) { +isc__nm_threadpool_initialize(uint32_t nworkers) { char buf[11]; int r = uv_os_getenv("UV_THREADPOOL_SIZE", buf, &(size_t){ sizeof(buf) }); if (r == UV_ENOENT) { - snprintf(buf, sizeof(buf), "%" PRIu32, workers); + snprintf(buf, sizeof(buf), "%" PRIu32, nworkers); uv_os_setenv("UV_THREADPOOL_SIZE", buf); } } @@ -212,11 +212,11 @@ isc__nm_threadpool_initialize(uint32_t workers) { #endif void -isc__netmgr_create(isc_mem_t *mctx, uint32_t workers, isc_nm_t **netmgrp) { +isc__netmgr_create(isc_mem_t *mctx, uint32_t nworkers, isc_nm_t **netmgrp) { isc_nm_t *mgr = NULL; char name[32]; - REQUIRE(workers > 0); + REQUIRE(nworkers > 0); #ifdef MAXIMAL_UV_VERSION if (uv_version() > MAXIMAL_UV_VERSION) { @@ -234,10 +234,13 @@ isc__netmgr_create(isc_mem_t *mctx, uint32_t workers, isc_nm_t **netmgrp) { uv_version_string(), UV_VERSION_STRING); } - isc__nm_threadpool_initialize(workers); + isc__nm_threadpool_initialize(nworkers); mgr = isc_mem_get(mctx, sizeof(*mgr)); - *mgr = (isc_nm_t){ .nworkers = workers }; + *mgr = (isc_nm_t){ + .nworkers = nworkers * 2, + .nlisteners = nworkers, + }; isc_mem_attach(mctx, &mgr->mctx); isc_mutex_init(&mgr->lock); @@ -272,11 +275,12 @@ isc__netmgr_create(isc_mem_t *mctx, uint32_t workers, isc_nm_t **netmgrp) { atomic_init(&mgr->keepalive, 30000); atomic_init(&mgr->advertised, 30000); - isc_barrier_init(&mgr->pausing, workers); - isc_barrier_init(&mgr->resuming, workers); + isc_barrier_init(&mgr->pausing, mgr->nworkers); + isc_barrier_init(&mgr->resuming, mgr->nworkers); - mgr->workers = isc_mem_get(mctx, workers * sizeof(isc__networker_t)); - for (size_t i = 0; i < workers; i++) { + mgr->workers = isc_mem_get(mctx, + mgr->nworkers * sizeof(isc__networker_t)); + for (int i = 0; i < mgr->nworkers; i++) { isc__networker_t *worker = &mgr->workers[i]; int r; @@ -310,7 +314,7 @@ isc__netmgr_create(isc_mem_t *mctx, uint32_t workers, isc_nm_t **netmgrp) { mgr->workers_running++; isc_thread_create(nm_thread, &mgr->workers[i], &worker->thread); - snprintf(name, sizeof(name), "isc-net-%04zu", i); + snprintf(name, sizeof(name), "isc-net-%04d", i); isc_thread_setname(worker->thread, name); } @@ -817,9 +821,15 @@ isc_nm_task_enqueue(isc_nm_t *nm, isc_task_t *task, int threadid) { isc__networker_t *worker = NULL; if (threadid == -1) { - tid = (int)isc_random_uniform(nm->nworkers); + tid = (int)isc_random_uniform(nm->nlisteners); + } else if (threadid == ISC_NM_TASK_SLOW_OFFSET) { + tid = nm->nlisteners + + (int)isc_random_uniform(nm->nworkers - nm->nlisteners); + } else if (threadid < ISC_NM_TASK_SLOW_OFFSET) { + tid = nm->nlisteners + (ISC_NM_TASK_SLOW(threadid) % + (nm->nworkers - nm->nlisteners)); } else { - tid = threadid % nm->nworkers; + tid = threadid % nm->nlisteners; } worker = &nm->workers[tid]; @@ -3778,7 +3788,7 @@ isc__nm_async_settlsctx(isc__networker_t *worker, isc__netievent_t *ev0) { static void set_tlsctx_workers(isc_nmsocket_t *listener, isc_tlsctx_t *tlsctx) { /* Update the TLS context reference for every worker thread. */ - for (size_t i = 0; i < (size_t)listener->mgr->nworkers; i++) { + for (size_t i = 0; i < (size_t)listener->mgr->nlisteners; i++) { isc__netievent__tlsctx_t *ievent = isc__nm_get_netievent_settlsctx(listener->mgr, listener, tlsctx); diff --git a/lib/isc/netmgr/tcp.c b/lib/isc/netmgr/tcp.c index 2a644fe..16b53cc 100644 --- a/lib/isc/netmgr/tcp.c +++ b/lib/isc/netmgr/tcp.c @@ -341,7 +341,7 @@ isc_nm_tcpconnect(isc_nm_t *mgr, isc_sockaddr_t *local, isc_sockaddr_t *peer, isc__nm_connectcb(sock, req, result, false); } else { isc__nmsocket_clearcb(sock); - sock->tid = isc_random_uniform(mgr->nworkers); + sock->tid = isc_random_uniform(mgr->nlisteners); isc__nm_connectcb(sock, req, result, true); } atomic_store(&sock->closed, true); @@ -362,7 +362,7 @@ isc_nm_tcpconnect(isc_nm_t *mgr, isc_sockaddr_t *local, isc_sockaddr_t *peer, isc__nm_put_netievent_tcpconnect(mgr, ievent); } else { atomic_init(&sock->active, false); - sock->tid = isc_random_uniform(mgr->nworkers); + sock->tid = isc_random_uniform(mgr->nlisteners); isc__nm_enqueue_ievent(&mgr->workers[sock->tid], (isc__netievent_t *)ievent); } @@ -457,7 +457,7 @@ isc_nm_listentcp(isc_nm_t *mgr, isc_sockaddr_t *iface, isc__nmsocket_init(sock, mgr, isc_nm_tcplistener, iface); atomic_init(&sock->rchildren, 0); - sock->nchildren = mgr->nworkers; + sock->nchildren = mgr->nlisteners; children_size = sock->nchildren * sizeof(sock->children[0]); sock->children = isc_mem_get(mgr->mctx, children_size); memset(sock->children, 0, children_size); diff --git a/lib/isc/netmgr/tcpdns.c b/lib/isc/netmgr/tcpdns.c index eda6aa6..b2a0b10 100644 --- a/lib/isc/netmgr/tcpdns.c +++ b/lib/isc/netmgr/tcpdns.c @@ -324,7 +324,7 @@ isc_nm_tcpdnsconnect(isc_nm_t *mgr, isc_sockaddr_t *local, isc_sockaddr_t *peer, isc__nm_put_netievent_tcpdnsconnect(mgr, ievent); } else { atomic_init(&sock->active, false); - sock->tid = isc_random_uniform(mgr->nworkers); + sock->tid = isc_random_uniform(mgr->nlisteners); isc__nm_enqueue_ievent(&mgr->workers[sock->tid], (isc__netievent_t *)ievent); } @@ -422,7 +422,7 @@ isc_nm_listentcpdns(isc_nm_t *mgr, isc_sockaddr_t *iface, isc__nmsocket_init(sock, mgr, isc_nm_tcpdnslistener, iface); atomic_init(&sock->rchildren, 0); - sock->nchildren = mgr->nworkers; + sock->nchildren = mgr->nlisteners; children_size = sock->nchildren * sizeof(sock->children[0]); sock->children = isc_mem_get(mgr->mctx, children_size); memset(sock->children, 0, children_size); @@ -808,6 +808,13 @@ isc__nm_tcpdns_processbuffer(isc_nmsocket_t *sock) { return (ISC_R_CANCELED); } + if (sock->client && !sock->recv_read) { + /* + * We are not reading data - stop here. + */ + return (ISC_R_CANCELED); + } + req = isc__nm_get_read_req(sock, NULL); REQUIRE(VALID_UVREQ(req)); diff --git a/lib/isc/netmgr/tlsdns.c b/lib/isc/netmgr/tlsdns.c index d30e33f..feeb1a8 100644 --- a/lib/isc/netmgr/tlsdns.c +++ b/lib/isc/netmgr/tlsdns.c @@ -419,7 +419,7 @@ isc_nm_tlsdnsconnect(isc_nm_t *mgr, isc_sockaddr_t *local, isc_sockaddr_t *peer, isc__nm_put_netievent_tlsdnsconnect(mgr, ievent); } else { atomic_init(&sock->active, false); - sock->tid = isc_random_uniform(mgr->nworkers); + sock->tid = isc_random_uniform(mgr->nlisteners); isc__nm_enqueue_ievent(&mgr->workers[sock->tid], (isc__netievent_t *)ievent); } @@ -532,7 +532,7 @@ isc_nm_listentlsdns(isc_nm_t *mgr, isc_sockaddr_t *iface, isc__nmsocket_init(sock, mgr, isc_nm_tlsdnslistener, iface); atomic_init(&sock->rchildren, 0); - sock->nchildren = mgr->nworkers; + sock->nchildren = mgr->nlisteners; children_size = sock->nchildren * sizeof(sock->children[0]); sock->children = isc_mem_get(mgr->mctx, children_size); memset(sock->children, 0, children_size); @@ -1016,6 +1016,13 @@ isc__nm_tlsdns_processbuffer(isc_nmsocket_t *sock) { return (ISC_R_CANCELED); } + if (sock->client && !sock->recv_read) { + /* + * We are not reading data - stop here. + */ + return (ISC_R_CANCELED); + } + req = isc__nm_get_read_req(sock, NULL); REQUIRE(VALID_UVREQ(req)); diff --git a/lib/isc/netmgr/tlsstream.c b/lib/isc/netmgr/tlsstream.c index 7b49071..a3fc6d2 100644 --- a/lib/isc/netmgr/tlsstream.c +++ b/lib/isc/netmgr/tlsstream.c @@ -1264,18 +1264,18 @@ isc__nm_tls_verify_tls_peer_result_string(const isc_nmhandle_t *handle) { static void tls_init_listener_tlsctx(isc_nmsocket_t *listener, isc_tlsctx_t *ctx) { - size_t nworkers; + size_t nlisteners; REQUIRE(VALID_NM(listener->mgr)); REQUIRE(ctx != NULL); - nworkers = (size_t)listener->mgr->nworkers; - INSIST(nworkers > 0); + nlisteners = (size_t)listener->mgr->nlisteners; + INSIST(nlisteners > 0); listener->tlsstream.listener_tls_ctx = isc_mem_get( - listener->mgr->mctx, sizeof(isc_tlsctx_t *) * nworkers); - listener->tlsstream.n_listener_tls_ctx = nworkers; - for (size_t i = 0; i < nworkers; i++) { + listener->mgr->mctx, sizeof(isc_tlsctx_t *) * nlisteners); + listener->tlsstream.n_listener_tls_ctx = nlisteners; + for (size_t i = 0; i < nlisteners; i++) { listener->tlsstream.listener_tls_ctx[i] = NULL; isc_tlsctx_attach(ctx, &listener->tlsstream.listener_tls_ctx[i]); diff --git a/lib/isc/netmgr/udp.c b/lib/isc/netmgr/udp.c index 1a0ee16..661de96 100644 --- a/lib/isc/netmgr/udp.c +++ b/lib/isc/netmgr/udp.c @@ -152,18 +152,19 @@ isc_nm_listenudp(isc_nm_t *mgr, isc_sockaddr_t *iface, isc_nm_recv_cb_t cb, isc_result_t result = ISC_R_SUCCESS; isc_nmsocket_t *sock = NULL; size_t children_size = 0; - REQUIRE(VALID_NM(mgr)); uv_os_sock_t fd = -1; + REQUIRE(VALID_NM(mgr)); + /* - * We are creating mgr->nworkers duplicated sockets, one + * We are creating mgr->nlisteners duplicated sockets, one * socket for each worker thread. */ sock = isc_mem_get(mgr->mctx, sizeof(isc_nmsocket_t)); isc__nmsocket_init(sock, mgr, isc_nm_udplistener, iface); atomic_init(&sock->rchildren, 0); - sock->nchildren = mgr->nworkers; + sock->nchildren = mgr->nlisteners; children_size = sock->nchildren * sizeof(sock->children[0]); sock->children = isc_mem_get(mgr->mctx, children_size); memset(sock->children, 0, children_size); @@ -693,6 +694,7 @@ isc__nm_udp_send(isc_nmhandle_t *handle, const isc_region_t *region, uint32_t maxudp = atomic_load(&sock->mgr->maxudp); int ntid; + REQUIRE(VALID_NMSOCK(sock)); INSIST(sock->type == isc_nm_udpsocket); /* @@ -1035,7 +1037,7 @@ isc_nm_udpconnect(isc_nm_t *mgr, isc_sockaddr_t *local, isc_sockaddr_t *peer, isc__nm_put_netievent_udpconnect(mgr, event); } else { atomic_init(&sock->active, false); - sock->tid = isc_random_uniform(mgr->nworkers); + sock->tid = isc_random_uniform(mgr->nlisteners); isc__nm_enqueue_ievent(&mgr->workers[sock->tid], (isc__netievent_t *)event); } diff --git a/lib/isc/netmgr/uv-compat.h b/lib/isc/netmgr/uv-compat.h index 3a10387..eea8744 100644 --- a/lib/isc/netmgr/uv-compat.h +++ b/lib/isc/netmgr/uv-compat.h @@ -72,7 +72,7 @@ uv_tcp_close_reset(uv_tcp_t *handle, uv_close_cb close_cb); #endif #if UV_VERSION_HEX < UV_VERSION(1, 34, 0) -#define uv_sleep(msec) usleep(msec * 1000) +#define uv_sleep(msec) usleep((msec) * 1000) #endif /* UV_VERSION_HEX < UV_VERSION(1, 34, 0) */ #if UV_VERSION_HEX < UV_VERSION(1, 27, 0) diff --git a/lib/isc/stats.c b/lib/isc/stats.c index 3e4676c..183030e 100644 --- a/lib/isc/stats.c +++ b/lib/isc/stats.c @@ -28,14 +28,22 @@ #define ISC_STATS_MAGIC ISC_MAGIC('S', 't', 'a', 't') #define ISC_STATS_VALID(x) ISC_MAGIC_VALID(x, ISC_STATS_MAGIC) -typedef atomic_int_fast64_t isc__atomic_statcounter_t; +/* + * Statistics are counted with an atomic int_fast64_t but exported to functions + * taking uint64_t (isc_stats_dumper_t). A 128-bit native and fast architecture + * doesn't exist in reality so these two are the same thing in practise. + * However, a silent truncation happening silently in the future is still not + * acceptable. + */ +STATIC_ASSERT(sizeof(isc_statscounter_t) <= sizeof(uint64_t), + "Exported statistics must fit into the statistic counter size"); struct isc_stats { unsigned int magic; isc_mem_t *mctx; isc_refcount_t references; int ncounters; - isc__atomic_statcounter_t *counters; + isc_atomic_statscounter_t *counters; }; static isc_result_t @@ -46,7 +54,7 @@ create_stats(isc_mem_t *mctx, int ncounters, isc_stats_t **statsp) { REQUIRE(statsp != NULL && *statsp == NULL); stats = isc_mem_get(mctx, sizeof(*stats)); - counters_alloc_size = sizeof(isc__atomic_statcounter_t) * ncounters; + counters_alloc_size = sizeof(isc_atomic_statscounter_t) * ncounters; stats->counters = isc_mem_get(mctx, counters_alloc_size); isc_refcount_init(&stats->references, 1); for (int i = 0; i < ncounters; i++) { @@ -82,7 +90,7 @@ isc_stats_detach(isc_stats_t **statsp) { if (isc_refcount_decrement(&stats->references) == 1) { isc_refcount_destroy(&stats->references); isc_mem_put(stats->mctx, stats->counters, - sizeof(isc__atomic_statcounter_t) * + sizeof(isc_atomic_statscounter_t) * stats->ncounters); isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats)); } @@ -125,7 +133,8 @@ isc_stats_dump(isc_stats_t *stats, isc_stats_dumper_t dump_fn, void *arg, REQUIRE(ISC_STATS_VALID(stats)); for (i = 0; i < stats->ncounters; i++) { - uint32_t counter = atomic_load_acquire(&stats->counters[i]); + isc_statscounter_t counter = + atomic_load_acquire(&stats->counters[i]); if ((options & ISC_STATSDUMP_VERBOSE) == 0 && counter == 0) { continue; } @@ -169,7 +178,7 @@ void isc_stats_resize(isc_stats_t **statsp, int ncounters) { isc_stats_t *stats; size_t counters_alloc_size; - isc__atomic_statcounter_t *newcounters; + isc_atomic_statscounter_t *newcounters; REQUIRE(statsp != NULL && *statsp != NULL); REQUIRE(ISC_STATS_VALID(*statsp)); @@ -182,7 +191,7 @@ isc_stats_resize(isc_stats_t **statsp, int ncounters) { } /* Grow number of counters. */ - counters_alloc_size = sizeof(isc__atomic_statcounter_t) * ncounters; + counters_alloc_size = sizeof(isc_atomic_statscounter_t) * ncounters; newcounters = isc_mem_get(stats->mctx, counters_alloc_size); for (int i = 0; i < ncounters; i++) { atomic_init(&newcounters[i], 0); @@ -192,7 +201,7 @@ isc_stats_resize(isc_stats_t **statsp, int ncounters) { atomic_store_release(&newcounters[i], counter); } isc_mem_put(stats->mctx, stats->counters, - sizeof(isc__atomic_statcounter_t) * stats->ncounters); + sizeof(isc_atomic_statscounter_t) * stats->ncounters); stats->counters = newcounters; stats->ncounters = ncounters; } diff --git a/lib/isc/trampoline.c b/lib/isc/trampoline.c index 58171d9..3e58fa7 100644 --- a/lib/isc/trampoline.c +++ b/lib/isc/trampoline.c @@ -22,6 +22,7 @@ #include <isc/thread.h> #include <isc/util.h> +#include "mem_p.h" #include "trampoline_p.h" #define ISC__TRAMPOLINE_UNUSED 0 @@ -148,7 +149,7 @@ isc__trampoline_detach(isc__trampoline_t *trampoline) { isc__trampoline_min = trampoline->tid; } - free(trampoline->jemalloc_enforce_init); + isc__mem_free_noctx(trampoline->jemalloc_enforce_init, 8); free(trampoline); uv_mutex_unlock(&isc__trampoline_lock); @@ -174,7 +175,7 @@ isc__trampoline_attach(isc__trampoline_t *trampoline) { * so that an optimizing compiler does not strip away such a pair of * malloc() + free() calls altogether, as it would foil the fix. */ - trampoline->jemalloc_enforce_init = malloc(8); + trampoline->jemalloc_enforce_init = isc__mem_alloc_noctx(8); uv_mutex_unlock(&isc__trampoline_lock); } diff --git a/lib/isc/url.c b/lib/isc/url.c index cccb712..320a863 100644 --- a/lib/isc/url.c +++ b/lib/isc/url.c @@ -44,7 +44,7 @@ #ifndef BIT_AT #define BIT_AT(a, i) \ (!!((unsigned int)(a)[(unsigned int)(i) >> 3] & \ - (1 << ((unsigned int)(i)&7)))) + (1 << ((unsigned int)(i) & 7)))) #endif #if HTTP_PARSER_STRICT @@ -201,7 +201,8 @@ typedef enum { #define IS_URL_CHAR(c) (BIT_AT(normal_url_char, (unsigned char)c)) #define IS_HOST_CHAR(c) (isalnum((unsigned char)c) || (c) == '.' || (c) == '-') #else -#define IS_URL_CHAR(c) (BIT_AT(normal_url_char, (unsigned char)c) || ((c)&0x80)) +#define IS_URL_CHAR(c) \ + (BIT_AT(normal_url_char, (unsigned char)c) || ((c) & 0x80)) #define IS_HOST_CHAR(c) \ (isalnum((unsigned char)c) || (c) == '.' || (c) == '-' || (c) == '_') #endif diff --git a/lib/isccc/Makefile.in b/lib/isccc/Makefile.in index 3fee7ca..2a8d865 100644 --- a/lib/isccc/Makefile.in +++ b/lib/isccc/Makefile.in @@ -104,11 +104,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_jemalloc.m4 \ $(top_srcdir)/m4/ax_lib_lmdb.m4 \ - $(top_srcdir)/m4/ax_perl_module.m4 \ $(top_srcdir)/m4/ax_posix_shell.m4 \ $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ - $(top_srcdir)/m4/ax_python_module.m4 \ $(top_srcdir)/m4/ax_restore_flags.m4 \ $(top_srcdir)/m4/ax_save_flags.m4 $(top_srcdir)/m4/ax_tls.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ diff --git a/lib/isccc/cc.c b/lib/isccc/cc.c index cbd9bad..71e5b14 100644 --- a/lib/isccc/cc.c +++ b/lib/isccc/cc.c @@ -255,7 +255,7 @@ list_towire(isccc_sexpr_t *list, isc_buffer_t **buffer) { } static isc_result_t -sign(unsigned char *data, unsigned int length, unsigned char *hmac, +sign(unsigned char *data, unsigned int length, unsigned char *out, uint32_t algorithm, isccc_region_t *secret) { const isc_md_type_t *md_type; isc_result_t result; @@ -304,9 +304,9 @@ sign(unsigned char *data, unsigned int length, unsigned char *hmac, return (result); } if (algorithm == ISCCC_ALG_HMACMD5) { - PUT_MEM(digestb64, HMD5_LENGTH, hmac); + PUT_MEM(digestb64, HMD5_LENGTH, out); } else { - PUT_MEM(digestb64, HSHA_LENGTH, hmac); + PUT_MEM(digestb64, HSHA_LENGTH, out); } return (ISC_R_SUCCESS); } @@ -382,7 +382,7 @@ verify(isccc_sexpr_t *alist, unsigned char *data, unsigned int length, isccc_region_t source; isccc_region_t target; isc_result_t result; - isccc_sexpr_t *_auth, *hmac; + isccc_sexpr_t *_auth, *hmacvalue; unsigned char digest[ISC_MAX_MD_SIZE]; unsigned int digestlen = sizeof(digest); unsigned char digestb64[HSHA_LENGTH * 4]; @@ -395,11 +395,11 @@ verify(isccc_sexpr_t *alist, unsigned char *data, unsigned int length, return (ISC_R_FAILURE); } if (algorithm == ISCCC_ALG_HMACMD5) { - hmac = isccc_alist_lookup(_auth, "hmd5"); + hmacvalue = isccc_alist_lookup(_auth, "hmd5"); } else { - hmac = isccc_alist_lookup(_auth, "hsha"); + hmacvalue = isccc_alist_lookup(_auth, "hsha"); } - if (!isccc_sexpr_binaryp(hmac)) { + if (!isccc_sexpr_binaryp(hmacvalue)) { return (ISC_R_FAILURE); } /* @@ -452,7 +452,7 @@ verify(isccc_sexpr_t *alist, unsigned char *data, unsigned int length, isccc_region_t *region; unsigned char *value; - region = isccc_sexpr_tobinary(hmac); + region = isccc_sexpr_tobinary(hmacvalue); if ((region->rend - region->rstart) != HMD5_LENGTH) { return (ISCCC_R_BADAUTH); } @@ -465,7 +465,7 @@ verify(isccc_sexpr_t *alist, unsigned char *data, unsigned int length, unsigned char *value; uint32_t valalg; - region = isccc_sexpr_tobinary(hmac); + region = isccc_sexpr_tobinary(hmacvalue); /* * Note: with non-MD5 algorithms, there's an extra octet diff --git a/lib/isccfg/Makefile.in b/lib/isccfg/Makefile.in index 38f6b93..5fe9255 100644 --- a/lib/isccfg/Makefile.in +++ b/lib/isccfg/Makefile.in @@ -104,11 +104,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_jemalloc.m4 \ $(top_srcdir)/m4/ax_lib_lmdb.m4 \ - $(top_srcdir)/m4/ax_perl_module.m4 \ $(top_srcdir)/m4/ax_posix_shell.m4 \ $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ - $(top_srcdir)/m4/ax_python_module.m4 \ $(top_srcdir)/m4/ax_restore_flags.m4 \ $(top_srcdir)/m4/ax_save_flags.m4 $(top_srcdir)/m4/ax_tls.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index 4e4c098..d5b28ba 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -2137,9 +2137,11 @@ static cfg_clausedef_t view_clauses[] = { { "request-nsid", &cfg_type_boolean, 0 }, { "request-sit", NULL, CFG_CLAUSEFLAG_ANCIENT }, { "require-server-cookie", &cfg_type_boolean, 0 }, - { "resolver-nonbackoff-tries", &cfg_type_uint32, 0 }, + { "resolver-nonbackoff-tries", &cfg_type_uint32, + CFG_CLAUSEFLAG_DEPRECATED }, { "resolver-query-timeout", &cfg_type_uint32, 0 }, - { "resolver-retry-interval", &cfg_type_uint32, 0 }, + { "resolver-retry-interval", &cfg_type_uint32, + CFG_CLAUSEFLAG_DEPRECATED }, { "response-padding", &cfg_type_resppadding, 0 }, { "response-policy", &cfg_type_rpz, 0 }, { "rfc2308-type1", NULL, CFG_CLAUSEFLAG_ANCIENT }, @@ -2161,8 +2163,7 @@ static cfg_clausedef_t view_clauses[] = { { "synth-from-dnssec", &cfg_type_boolean, 0 }, { "topology", NULL, CFG_CLAUSEFLAG_ANCIENT }, { "transfer-format", &cfg_type_transferformat, 0 }, - { "trust-anchor-telemetry", &cfg_type_boolean, - CFG_CLAUSEFLAG_EXPERIMENTAL }, + { "trust-anchor-telemetry", &cfg_type_boolean, 0 }, { "use-queryport-pool", NULL, CFG_CLAUSEFLAG_ANCIENT }, { "validate-except", &cfg_type_namelist, 0 }, { "v6-bias", &cfg_type_uint32, 0 }, |