2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

Remove logging context (isc_log_t) from the public namespace

Now that the logging uses single global context, remove the isc_log_t
from the public namespace.
This commit is contained in:
Ondřej Surý 2024-08-13 18:20:26 +02:00
parent 043f11de3f
commit 8506102216
129 changed files with 2215 additions and 2552 deletions

View File

@ -549,17 +549,16 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
} }
isc_result_t isc_result_t
setup_logging(isc_mem_t *mctx ISC_ATTR_UNUSED, FILE *errout, isc_log_t **logp) { setup_logging(FILE *errout) {
isc_logdestination_t destination; isc_logdestination_t destination;
isc_logconfig_t *logconfig = NULL; isc_logconfig_t *logconfig = NULL;
isc_log_t *log = NULL;
isc_log_registercategories(log, categories); isc_log_registercategories(categories);
dns_log_init(log); dns_log_init();
cfg_log_init(log); cfg_log_init();
ns_log_init(log); ns_log_init();
logconfig = isc_logconfig_get(log); logconfig = isc_logconfig_get();
destination.file.stream = errout; destination.file.stream = errout;
destination.file.name = NULL; destination.file.name = NULL;
destination.file.versions = ISC_LOG_ROLLNEVER; destination.file.versions = ISC_LOG_ROLLNEVER;
@ -570,7 +569,6 @@ setup_logging(isc_mem_t *mctx ISC_ATTR_UNUSED, FILE *errout, isc_log_t **logp) {
RUNTIME_CHECK(isc_log_usechannel(logconfig, "stderr", NULL, NULL) == RUNTIME_CHECK(isc_log_usechannel(logconfig, "stderr", NULL, NULL) ==
ISC_R_SUCCESS); ISC_R_SUCCESS);
*logp = log;
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }

View File

@ -29,7 +29,7 @@
ISC_LANG_BEGINDECLS ISC_LANG_BEGINDECLS
isc_result_t isc_result_t
setup_logging(isc_mem_t *mctx, FILE *errout, isc_log_t **logp); setup_logging(FILE *errout);
isc_result_t isc_result_t
load_zone(isc_mem_t *mctx, const char *zonename, const char *filename, load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,

View File

@ -44,8 +44,6 @@
static const char *program = "named-checkconf"; static const char *program = "named-checkconf";
isc_log_t *logc = NULL;
#define CHECK(r) \ #define CHECK(r) \
do { \ do { \
result = (r); \ result = (r); \
@ -83,7 +81,7 @@ directory_callback(const char *clausename, const cfg_obj_t *obj, void *arg) {
directory = cfg_obj_asstring(obj); directory = cfg_obj_asstring(obj);
result = isc_dir_chdir(directory); result = isc_dir_chdir(directory);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log(obj, logc, ISC_LOG_ERROR, cfg_obj_log(obj, ISC_LOG_ERROR,
"change directory to '%s' failed: %s\n", directory, "change directory to '%s' failed: %s\n", directory,
isc_result_totext(result)); isc_result_totext(result));
return (result); return (result);
@ -725,9 +723,9 @@ main(int argc, char **argv) {
conffile = NAMED_CONFFILE; conffile = NAMED_CONFFILE;
} }
CHECK(setup_logging(mctx, stdout, &logc)); CHECK(setup_logging(stdout));
CHECK(cfg_parser_create(mctx, logc, &parser)); CHECK(cfg_parser_create(mctx, &parser));
if (nodeprecate) { if (nodeprecate) {
cfg_parser_setflags(parser, CFG_PCTX_NODEPRECATED, true); cfg_parser_setflags(parser, CFG_PCTX_NODEPRECATED, true);
@ -735,7 +733,7 @@ main(int argc, char **argv) {
cfg_parser_setcallback(parser, directory_callback, NULL); cfg_parser_setcallback(parser, directory_callback, NULL);
CHECK(cfg_parse_file(parser, conffile, &cfg_type_namedconf, &config)); CHECK(cfg_parse_file(parser, conffile, &cfg_type_namedconf, &config));
CHECK(isccfg_check_namedconf(config, checkflags, logc, mctx)); CHECK(isccfg_check_namedconf(config, checkflags, mctx));
if (load_zones || list_zones) { if (load_zones || list_zones) {
CHECK(load_zones_fromconfig(config, mctx, list_zones)); CHECK(load_zones_fromconfig(config, mctx, list_zones));
} }

View File

@ -95,7 +95,6 @@ main(int argc, char **argv) {
int c; int c;
char *origin = NULL; char *origin = NULL;
const char *filename = NULL; const char *filename = NULL;
isc_log_t *lctx = NULL;
isc_result_t result; isc_result_t result;
char classname_in[] = "IN"; char classname_in[] = "IN";
char *classname = classname_in; char *classname = classname_in;
@ -525,8 +524,7 @@ main(int argc, char **argv) {
isc_mem_create(&mctx); isc_mem_create(&mctx);
if (!quiet) { if (!quiet) {
RUNTIME_CHECK(setup_logging(mctx, errout, &lctx) == RUNTIME_CHECK(setup_logging(errout) == ISC_R_SUCCESS);
ISC_R_SUCCESS);
} }
origin = argv[isc_commandline_index++]; origin = argv[isc_commandline_index++];

View File

@ -94,7 +94,6 @@
/* Variables used internally by delv. */ /* Variables used internally by delv. */
char *progname = NULL; char *progname = NULL;
static isc_mem_t *mctx = NULL; static isc_mem_t *mctx = NULL;
static isc_log_t *lctx = NULL;
static dns_view_t *view = NULL; static dns_view_t *view = NULL;
static ns_server_t *sctx = NULL; static ns_server_t *sctx = NULL;
static ns_interface_t *ifp = NULL; static ns_interface_t *ifp = NULL;
@ -301,14 +300,14 @@ delv_log(int level, const char *fmt, ...) {
va_list ap; va_list ap;
char msgbuf[2048]; char msgbuf[2048];
if (!isc_log_wouldlog(lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
va_start(ap, fmt); va_start(ap, fmt);
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
isc_log_write(lctx, LOGCATEGORY_DEFAULT, LOGMODULE_DEFAULT, level, "%s", isc_log_write(LOGCATEGORY_DEFAULT, LOGMODULE_DEFAULT, level, "%s",
msgbuf); msgbuf);
va_end(ap); va_end(ap);
} }
@ -322,12 +321,12 @@ setup_logging(FILE *errout) {
isc_logconfig_t *logconfig = NULL; isc_logconfig_t *logconfig = NULL;
int packetlevel = 10; int packetlevel = 10;
isc_log_registercategories(lctx, categories); isc_log_registercategories(categories);
isc_log_registermodules(lctx, modules); isc_log_registermodules(modules);
dns_log_init(lctx); dns_log_init();
cfg_log_init(lctx); cfg_log_init();
logconfig = isc_logconfig_get(lctx); logconfig = isc_logconfig_get();
destination.file.stream = errout; destination.file.stream = errout;
destination.file.name = NULL; destination.file.name = NULL;
destination.file.versions = ISC_LOG_ROLLNEVER; destination.file.versions = ISC_LOG_ROLLNEVER;
@ -336,7 +335,7 @@ setup_logging(FILE *errout) {
ISC_LOG_DYNAMIC, &destination, ISC_LOG_DYNAMIC, &destination,
ISC_LOG_PRINTPREFIX); ISC_LOG_PRINTPREFIX);
isc_log_setdebuglevel(lctx, loglevel); isc_log_setdebuglevel(loglevel);
isc_log_settag(logconfig, ";; "); isc_log_settag(logconfig, ";; ");
result = isc_log_usechannel(logconfig, "stderr", result = isc_log_usechannel(logconfig, "stderr",
@ -814,14 +813,14 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client, dns_view_t *toview) {
cleanup: cleanup:
if (result == DST_R_NOCRYPTO) { if (result == DST_R_NOCRYPTO) {
cfg_obj_log(key, lctx, ISC_LOG_ERROR, "no crypto support"); cfg_obj_log(key, ISC_LOG_ERROR, "no crypto support");
} else if (result == DST_R_UNSUPPORTEDALG) { } else if (result == DST_R_UNSUPPORTEDALG) {
cfg_obj_log(key, lctx, ISC_LOG_WARNING, cfg_obj_log(key, ISC_LOG_WARNING,
"skipping trusted key '%s': %s", keynamestr, "skipping trusted key '%s': %s", keynamestr,
isc_result_totext(result)); isc_result_totext(result));
result = ISC_R_SUCCESS; result = ISC_R_SUCCESS;
} else if (result != ISC_R_SUCCESS) { } else if (result != ISC_R_SUCCESS) {
cfg_obj_log(key, lctx, ISC_LOG_ERROR, cfg_obj_log(key, ISC_LOG_ERROR,
"failed to add trusted key '%s': %s", keynamestr, "failed to add trusted key '%s': %s", keynamestr,
isc_result_totext(result)); isc_result_totext(result));
result = ISC_R_FAILURE; result = ISC_R_FAILURE;
@ -876,7 +875,7 @@ setup_dnsseckeys(dns_client_t *client, dns_view_t *toview) {
CHECK(convert_name(&afn, &anchor_name, trust_anchor)); CHECK(convert_name(&afn, &anchor_name, trust_anchor));
} }
CHECK(cfg_parser_create(mctx, dns_lctx, &parser)); CHECK(cfg_parser_create(mctx, &parser));
if (anchorfile != NULL) { if (anchorfile != NULL) {
if (access(anchorfile, R_OK) != 0) { if (access(anchorfile, R_OK) != 0) {

View File

@ -99,7 +99,6 @@ bool port_set = false;
unsigned int timeout = 0; unsigned int timeout = 0;
unsigned int extrabytes; unsigned int extrabytes;
isc_mem_t *mctx = NULL; isc_mem_t *mctx = NULL;
isc_log_t *lctx = NULL;
isc_nm_t *netmgr = NULL; isc_nm_t *netmgr = NULL;
isc_loopmgr_t *loopmgr = NULL; isc_loopmgr_t *loopmgr = NULL;
isc_loop_t *mainloop = NULL; isc_loop_t *mainloop = NULL;
@ -1096,7 +1095,7 @@ read_confkey(void) {
return (ISC_R_FILENOTFOUND); return (ISC_R_FILENOTFOUND);
} }
result = cfg_parser_create(mctx, NULL, &pctx); result = cfg_parser_create(mctx, &pctx);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
goto cleanup; goto cleanup;
} }
@ -1361,14 +1360,14 @@ setup_libs(void) {
isc_managers_create(&mctx, 1, &loopmgr, &netmgr); isc_managers_create(&mctx, 1, &loopmgr, &netmgr);
dns_log_init(lctx); dns_log_init();
logconfig = isc_logconfig_get(lctx); logconfig = isc_logconfig_get();
result = isc_log_usechannel(logconfig, "default_debug", NULL, NULL); result = isc_log_usechannel(logconfig, "default_debug", NULL, NULL);
check_result(result, "isc_log_usechannel"); check_result(result, "isc_log_usechannel");
isc_log_setdebuglevel(lctx, 0); isc_log_setdebuglevel(0);
isc_mem_setname(mctx, "dig"); isc_mem_setname(mctx, "dig");
mainloop = isc_loop_main(loopmgr); mainloop = isc_loop_main(loopmgr);

View File

@ -63,7 +63,6 @@ const char *program = "dnssec-cds";
/* /*
* Infrastructure * Infrastructure
*/ */
static isc_log_t *lctx = NULL;
static isc_mem_t *mctx = NULL; static isc_mem_t *mctx = NULL;
/* /*
@ -1070,9 +1069,6 @@ cleanup(void) {
free_keytable(&new_key_tbl); free_keytable(&new_key_tbl);
} }
free_all_sets(); free_all_sets();
if (lctx != NULL) {
cleanup_logging(&lctx);
}
if (mctx != NULL) { if (mctx != NULL) {
if (print_mem_stats && verbose > 10) { if (print_mem_stats && verbose > 10) {
isc_mem_stats(mctx, stdout); isc_mem_stats(mctx, stdout);
@ -1173,7 +1169,7 @@ main(int argc, char *argv[]) {
dtype[0] = DNS_DSDIGEST_SHA256; dtype[0] = DNS_DSDIGEST_SHA256;
} }
setup_logging(mctx, &lctx); setup_logging();
if (ds_path == NULL) { if (ds_path == NULL) {
fatal("missing -d DS pathname"); fatal("missing -d DS pathname");

View File

@ -368,7 +368,6 @@ main(int argc, char **argv) {
bool usekeyset = false; bool usekeyset = false;
bool showall = false; bool showall = false;
isc_result_t result; isc_result_t result;
isc_log_t *log = NULL;
dns_rdataset_t rdataset; dns_rdataset_t rdataset;
dns_rdata_t rdata; dns_rdata_t rdata;
@ -489,7 +488,7 @@ main(int argc, char **argv) {
fatal("extraneous arguments"); fatal("extraneous arguments");
} }
setup_logging(mctx, &log); setup_logging();
dns_rdataset_init(&rdataset); dns_rdataset_init(&rdataset);
@ -542,7 +541,6 @@ main(int argc, char **argv) {
if (dns_rdataset_isassociated(&rdataset)) { if (dns_rdataset_isassociated(&rdataset)) {
dns_rdataset_disassociate(&rdataset); dns_rdataset_disassociate(&rdataset);
} }
cleanup_logging(&log);
if (verbose > 10) { if (verbose > 10) {
isc_mem_stats(mctx, stdout); isc_mem_stats(mctx, stdout);
} }

View File

@ -299,7 +299,6 @@ main(int argc, char **argv) {
char *endp; char *endp;
int ch; int ch;
isc_result_t result; isc_result_t result;
isc_log_t *log = NULL;
dns_rdataset_t rdataset; dns_rdataset_t rdataset;
dns_rdata_t rdata; dns_rdata_t rdata;
isc_stdtime_t now = isc_stdtime_now(); isc_stdtime_t now = isc_stdtime_now();
@ -408,7 +407,7 @@ main(int argc, char **argv) {
fatal("extraneous arguments"); fatal("extraneous arguments");
} }
setup_logging(mctx, &log); setup_logging();
dns_rdataset_init(&rdataset); dns_rdataset_init(&rdataset);
@ -452,7 +451,6 @@ main(int argc, char **argv) {
if (dns_rdataset_isassociated(&rdataset)) { if (dns_rdataset_isassociated(&rdataset)) {
dns_rdataset_disassociate(&rdataset); dns_rdataset_disassociate(&rdataset);
} }
cleanup_logging(&log);
if (verbose > 10) { if (verbose > 10) {
isc_mem_stats(mctx, stdout); isc_mem_stats(mctx, stdout);
} }

View File

@ -125,7 +125,6 @@ main(int argc, char **argv) {
isc_textregion_t r; isc_textregion_t r;
char filename[255]; char filename[255];
isc_buffer_t buf; isc_buffer_t buf;
isc_log_t *log = NULL;
dns_rdataclass_t rdclass; dns_rdataclass_t rdclass;
int options = DST_TYPE_PRIVATE | DST_TYPE_PUBLIC; int options = DST_TYPE_PRIVATE | DST_TYPE_PUBLIC;
char *label = NULL; char *label = NULL;
@ -332,7 +331,7 @@ main(int argc, char **argv) {
} }
} }
setup_logging(mctx, &log); setup_logging();
if (predecessor == NULL) { if (predecessor == NULL) {
if (label == NULL) { if (label == NULL) {
@ -723,7 +722,6 @@ main(int argc, char **argv) {
dst_key_free(&prevkey); dst_key_free(&prevkey);
} }
cleanup_logging(&log);
if (verbose > 10) { if (verbose > 10) {
isc_mem_stats(mctx, stdout); isc_mem_stats(mctx, stdout);
} }

View File

@ -72,8 +72,6 @@ const char *program = "dnssec-keygen";
static int min_rsa = 1024; static int min_rsa = 1024;
static int min_dh = 128; static int min_dh = 128;
isc_log_t *lctx = NULL;
ISC_NORETURN static void ISC_NORETURN static void
usage(void); usage(void);
@ -1145,7 +1143,7 @@ main(int argc, char **argv) {
min_rsa = min_dh = 2048; min_rsa = min_dh = 2048;
} }
setup_logging(mctx, &lctx); setup_logging();
ctx.rdclass = strtoclass(classname); ctx.rdclass = strtoclass(classname);
@ -1225,7 +1223,7 @@ main(int argc, char **argv) {
dns_kasp_t *kasp = NULL; dns_kasp_t *kasp = NULL;
dns_kasp_key_t *kaspkey = NULL; dns_kasp_key_t *kaspkey = NULL;
RUNTIME_CHECK(cfg_parser_create(mctx, lctx, &parser) == RUNTIME_CHECK(cfg_parser_create(mctx, &parser) ==
ISC_R_SUCCESS); ISC_R_SUCCESS);
if (cfg_parse_file(parser, ctx.configfile, if (cfg_parse_file(parser, ctx.configfile,
&cfg_type_namedconf, &cfg_type_namedconf,
@ -1236,8 +1234,8 @@ main(int argc, char **argv) {
ctx.policy, ctx.configfile); ctx.policy, ctx.configfile);
} }
kasp_from_conf(config, mctx, lctx, ctx.policy, kasp_from_conf(config, mctx, ctx.policy, ctx.directory,
ctx.directory, &kasp); &kasp);
if (kasp == NULL) { if (kasp == NULL) {
fatal("failed to load dnssec-policy '%s'", fatal("failed to load dnssec-policy '%s'",
ctx.policy); ctx.policy);
@ -1281,7 +1279,6 @@ main(int argc, char **argv) {
keygen(&ctx, mctx, argc, argv); keygen(&ctx, mctx, argc, argv);
} }
cleanup_logging(&lctx);
if (verbose > 10) { if (verbose > 10) {
isc_mem_stats(mctx, stdout); isc_mem_stats(mctx, stdout);
} }

View File

@ -39,7 +39,6 @@ const char *program = "dnssec-ksr";
/* /*
* Infrastructure * Infrastructure
*/ */
static isc_log_t *lctx = NULL;
static isc_mem_t *mctx = NULL; static isc_mem_t *mctx = NULL;
/* /*
* The domain we are working on * The domain we are working on
@ -164,14 +163,14 @@ getkasp(ksr_ctx_t *ksr, dns_kasp_t **kasp) {
cfg_parser_t *parser = NULL; cfg_parser_t *parser = NULL;
cfg_obj_t *config = NULL; cfg_obj_t *config = NULL;
RUNTIME_CHECK(cfg_parser_create(mctx, lctx, &parser) == ISC_R_SUCCESS); RUNTIME_CHECK(cfg_parser_create(mctx, &parser) == ISC_R_SUCCESS);
if (cfg_parse_file(parser, ksr->configfile, &cfg_type_namedconf, if (cfg_parse_file(parser, ksr->configfile, &cfg_type_namedconf,
&config) != ISC_R_SUCCESS) &config) != ISC_R_SUCCESS)
{ {
fatal("unable to load dnssec-policy '%s' from '%s'", fatal("unable to load dnssec-policy '%s' from '%s'",
ksr->policy, ksr->configfile); ksr->policy, ksr->configfile);
} }
kasp_from_conf(config, mctx, lctx, ksr->policy, ksr->keydir, kasp); kasp_from_conf(config, mctx, ksr->policy, ksr->keydir, kasp);
if (*kasp == NULL) { if (*kasp == NULL) {
fatal("failed to load dnssec-policy '%s'", ksr->policy); fatal("failed to load dnssec-policy '%s'", ksr->policy);
} }
@ -1272,7 +1271,7 @@ main(int argc, char *argv[]) {
min_rsa = min_dh = 2048; min_rsa = min_dh = 2048;
} }
setup_logging(mctx, &lctx); setup_logging();
if (set_fips_mode) { if (set_fips_mode) {
#if OPENSSL_VERSION_NUMBER >= 0x30000000L #if OPENSSL_VERSION_NUMBER >= 0x30000000L

View File

@ -226,7 +226,6 @@ main(int argc, char **argv) {
bool epoch = false; bool epoch = false;
bool changed = false; bool changed = false;
bool write_state = false; bool write_state = false;
isc_log_t *log = NULL;
isc_stdtime_t syncadd = 0, syncdel = 0; isc_stdtime_t syncadd = 0, syncdel = 0;
bool unsetsyncadd = false, setsyncadd = false; bool unsetsyncadd = false, setsyncadd = false;
bool unsetsyncdel = false, setsyncdel = false; bool unsetsyncdel = false, setsyncdel = false;
@ -245,7 +244,7 @@ main(int argc, char **argv) {
isc_mem_create(&mctx); isc_mem_create(&mctx);
setup_logging(mctx, &log); setup_logging();
isc_commandline_errprint = false; isc_commandline_errprint = false;
@ -947,7 +946,6 @@ main(int argc, char **argv) {
if (verbose > 10) { if (verbose > 10) {
isc_mem_stats(mctx, stdout); isc_mem_stats(mctx, stdout);
} }
cleanup_logging(&log);
isc_mem_free(mctx, directory); isc_mem_free(mctx, directory);
isc_mem_destroy(&mctx); isc_mem_destroy(&mctx);

View File

@ -3350,7 +3350,6 @@ main(int argc, char *argv[]) {
isc_time_t sign_start, sign_finish; isc_time_t sign_start, sign_finish;
dns_dnsseckey_t *key; dns_dnsseckey_t *key;
isc_result_t result, vresult; isc_result_t result, vresult;
isc_log_t *log = NULL;
bool free_output = false; bool free_output = false;
int tempfilelen = 0; int tempfilelen = 0;
dns_rdataclass_t rdclass; dns_rdataclass_t rdclass;
@ -3745,7 +3744,7 @@ main(int argc, char *argv[]) {
} }
} }
setup_logging(mctx, &log); setup_logging();
argc -= isc_commandline_index; argc -= isc_commandline_index;
argv += isc_commandline_index; argv += isc_commandline_index;
@ -4116,7 +4115,6 @@ main(int argc, char *argv[]) {
dns_master_styledestroy(&dsstyle, mctx); dns_master_styledestroy(&dsstyle, mctx);
cleanup_logging(&log);
if (verbose > 10) { if (verbose > 10) {
isc_mem_stats(mctx, stdout); isc_mem_stats(mctx, stdout);
} }

View File

@ -168,7 +168,6 @@ main(int argc, char *argv[]) {
char *origin = NULL, *file = NULL; char *origin = NULL, *file = NULL;
char *inputformatstr = NULL; char *inputformatstr = NULL;
isc_result_t result; isc_result_t result;
isc_log_t *log = NULL;
char *classname = NULL; char *classname = NULL;
dns_rdataclass_t rdclass; dns_rdataclass_t rdclass;
char *endp; char *endp;
@ -276,7 +275,7 @@ main(int argc, char *argv[]) {
rdclass = strtoclass(classname); rdclass = strtoclass(classname);
setup_logging(mctx, &log); setup_logging();
argc -= isc_commandline_index; argc -= isc_commandline_index;
argv += isc_commandline_index; argv += isc_commandline_index;
@ -326,7 +325,6 @@ main(int argc, char *argv[]) {
dns_db_closeversion(gdb, &gversion, false); dns_db_closeversion(gdb, &gversion, false);
dns_db_detach(&gdb); dns_db_detach(&gdb);
cleanup_logging(&log);
if (verbose > 10) { if (verbose > 10) {
isc_mem_stats(mctx, stdout); isc_mem_stats(mctx, stdout);
} }

View File

@ -128,10 +128,9 @@ sig_format(dns_rdata_rrsig_t *sig, char *cp, unsigned int size) {
} }
void void
setup_logging(isc_mem_t *mctx ISC_ATTR_UNUSED, isc_log_t **logp) { setup_logging(void) {
isc_logdestination_t destination; isc_logdestination_t destination;
isc_logconfig_t *logconfig = NULL; isc_logconfig_t *logconfig = NULL;
isc_log_t *log = NULL;
int level; int level;
if (verbose < 0) { if (verbose < 0) {
@ -153,9 +152,9 @@ setup_logging(isc_mem_t *mctx ISC_ATTR_UNUSED, isc_log_t **logp) {
break; break;
} }
dns_log_init(log); dns_log_init();
logconfig = isc_logconfig_get(log); logconfig = isc_logconfig_get();
isc_log_settag(logconfig, program); isc_log_settag(logconfig, program);
@ -175,20 +174,6 @@ setup_logging(isc_mem_t *mctx ISC_ATTR_UNUSED, isc_log_t **logp) {
RUNTIME_CHECK(isc_log_usechannel(logconfig, "stderr", NULL, NULL) == RUNTIME_CHECK(isc_log_usechannel(logconfig, "stderr", NULL, NULL) ==
ISC_R_SUCCESS); ISC_R_SUCCESS);
*logp = log;
}
void
cleanup_logging(isc_log_t **logp) {
REQUIRE(logp != NULL);
isc_log_t *log = *logp;
*logp = NULL;
if (log == NULL) {
return;
}
} }
static isc_stdtime_t static isc_stdtime_t
@ -598,8 +583,8 @@ cleanup:
} }
void void
kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, isc_log_t *lctx, kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, const char *name,
const char *name, const char *keydir, dns_kasp_t **kaspp) { const char *keydir, dns_kasp_t **kaspp) {
isc_result_t result = ISC_R_NOTFOUND; isc_result_t result = ISC_R_NOTFOUND;
const cfg_listelt_t *element; const cfg_listelt_t *element;
const cfg_obj_t *kasps = NULL; const cfg_obj_t *kasps = NULL;
@ -618,8 +603,7 @@ kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, isc_log_t *lctx,
{ {
cfg_obj_t *kconfig = cfg_listelt_value(element); cfg_obj_t *kconfig = cfg_listelt_value(element);
ks = NULL; ks = NULL;
result = cfg_keystore_fromconfig(kconfig, mctx, lctx, &kslist, result = cfg_keystore_fromconfig(kconfig, mctx, &kslist, NULL);
NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
fatal("failed to configure key-store '%s': %s", fatal("failed to configure key-store '%s': %s",
cfg_obj_asstring(cfg_tuple_get(kconfig, "name")), cfg_obj_asstring(cfg_tuple_get(kconfig, "name")),
@ -628,7 +612,7 @@ kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, isc_log_t *lctx,
} }
/* Default key-directory key store. */ /* Default key-directory key store. */
ks = NULL; ks = NULL;
(void)cfg_keystore_fromconfig(NULL, mctx, lctx, &kslist, &ks); (void)cfg_keystore_fromconfig(NULL, mctx, &kslist, &ks);
INSIST(ks != NULL); INSIST(ks != NULL);
if (keydir != NULL) { if (keydir != NULL) {
/* '-K keydir' takes priority */ /* '-K keydir' takes priority */
@ -648,8 +632,8 @@ kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, isc_log_t *lctx,
continue; continue;
} }
result = cfg_kasp_fromconfig(kconfig, NULL, true, mctx, lctx, result = cfg_kasp_fromconfig(kconfig, NULL, true, mctx, &kslist,
&kslist, &kasplist, &kasp); &kasplist, &kasp);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
fatal("failed to configure dnssec-policy '%s': %s", fatal("failed to configure dnssec-policy '%s': %s",
cfg_obj_asstring(cfg_tuple_get(kconfig, "name")), cfg_obj_asstring(cfg_tuple_get(kconfig, "name")),

View File

@ -75,10 +75,7 @@ sig_format(dns_rdata_rrsig_t *sig, char *cp, unsigned int size);
(DNS_NAME_FORMATSIZE + DNS_SECALG_FORMATSIZE + sizeof("65535")) (DNS_NAME_FORMATSIZE + DNS_SECALG_FORMATSIZE + sizeof("65535"))
void void
setup_logging(isc_mem_t *mctx, isc_log_t **logp); setup_logging(void);
void
cleanup_logging(isc_log_t **logp);
dns_ttl_t dns_ttl_t
strtottl(const char *str); strtottl(const char *str);
@ -118,5 +115,5 @@ void
loadjournal(isc_mem_t *mctx, dns_db_t *db, const char *journal); loadjournal(isc_mem_t *mctx, dns_db_t *db, const char *journal);
void void
kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, isc_log_t *lctx, kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, const char *name,
const char *name, const char *keydir, dns_kasp_t **kaspp); const char *keydir, dns_kasp_t **kaspp);

View File

@ -451,8 +451,8 @@ named_config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
r.length = strlen(r.base); r.length = strlen(r.base);
result = dns_rdataclass_fromtext(classp, &r); result = dns_rdataclass_fromtext(classp, &r);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log(classobj, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(classobj, ISC_LOG_ERROR, "unknown class '%s'",
"unknown class '%s'", r.base); r.base);
} }
return (result); return (result);
} }
@ -471,8 +471,8 @@ named_config_gettype(const cfg_obj_t *typeobj, dns_rdatatype_t deftype,
r.length = strlen(r.base); r.length = strlen(r.base);
result = dns_rdatatype_fromtext(typep, &r); result = dns_rdatatype_fromtext(typep, &r);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log(typeobj, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(typeobj, ISC_LOG_ERROR, "unknown type '%s'",
"unknown type '%s'", r.base); r.base);
} }
return (result); return (result);
} }
@ -663,7 +663,7 @@ newlist:
if (cfg_obj_isuint32(portobj)) { if (cfg_obj_isuint32(portobj)) {
uint32_t val = cfg_obj_asuint32(portobj); uint32_t val = cfg_obj_asuint32(portobj);
if (val > UINT16_MAX) { if (val > UINT16_MAX) {
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(portobj, ISC_LOG_ERROR,
"port '%u' out of range", val); "port '%u' out of range", val);
result = ISC_R_RANGE; result = ISC_R_RANGE;
goto cleanup; goto cleanup;
@ -718,7 +718,7 @@ resume:
tresult = named_config_getremotesdef(config, listtype, tresult = named_config_getremotesdef(config, listtype,
listname, &list); listname, &list);
if (tresult == ISC_R_NOTFOUND) { if (tresult == ISC_R_NOTFOUND) {
cfg_obj_log(addr, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(addr, ISC_LOG_ERROR,
"%s \"%s\" not found", listtype, "%s \"%s\" not found", listtype,
listname); listname);
@ -890,8 +890,7 @@ named_config_getport(const cfg_obj_t *config, const char *type,
result = named_config_get(maps, type, &portobj); result = named_config_get(maps, type, &portobj);
INSIST(result == ISC_R_SUCCESS); INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_asuint32(portobj) >= UINT16_MAX) { if (cfg_obj_asuint32(portobj) >= UINT16_MAX) {
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(portobj, ISC_LOG_ERROR, "port '%u' out of range",
"port '%u' out of range",
cfg_obj_asuint32(portobj)); cfg_obj_asuint32(portobj));
return (ISC_R_RANGE); return (ISC_R_RANGE);
} }

View File

@ -135,7 +135,7 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
!command_compare(command, NAMED_COMMAND_TESTGEN) && !command_compare(command, NAMED_COMMAND_TESTGEN) &&
!command_compare(command, NAMED_COMMAND_ZONESTATUS)) !command_compare(command, NAMED_COMMAND_ZONESTATUS))
{ {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_CONTROL, log_level, NAMED_LOGMODULE_CONTROL, log_level,
"rejecting restricted control channel " "rejecting restricted control channel "
"command '%s'", "command '%s'",
@ -144,9 +144,9 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
goto cleanup; goto cleanup;
} }
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_CONTROL,
NAMED_LOGMODULE_CONTROL, log_level, log_level, "received control channel command '%s'",
"received control channel command '%s'", cmdline); cmdline);
/* /*
* After the lengthy "halt" and "stop", the commands are * After the lengthy "halt" and "stop", the commands are
@ -203,7 +203,7 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
{ {
result = named_server_changezone(named_g_server, cmdline, text); result = named_server_changezone(named_g_server, cmdline, text);
} else if (command_compare(command, NAMED_COMMAND_CLOSELOGS)) { } else if (command_compare(command, NAMED_COMMAND_CLOSELOGS)) {
isc_log_closefilelogs(named_g_lctx); isc_log_closefilelogs();
result = ISC_R_SUCCESS; result = ISC_R_SUCCESS;
} else if (command_compare(command, NAMED_COMMAND_DELZONE)) { } else if (command_compare(command, NAMED_COMMAND_DELZONE)) {
result = named_server_delzone(named_g_server, lex, text); result = named_server_delzone(named_g_server, lex, text);
@ -238,7 +238,7 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
result = named_server_notifycommand(named_g_server, lex, text); result = named_server_notifycommand(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_NOTRACE)) { } else if (command_compare(command, NAMED_COMMAND_NOTRACE)) {
named_g_debuglevel = 0; named_g_debuglevel = 0;
isc_log_setdebuglevel(named_g_lctx, named_g_debuglevel); isc_log_setdebuglevel(named_g_debuglevel);
result = ISC_R_SUCCESS; result = ISC_R_SUCCESS;
} else if (command_compare(command, NAMED_COMMAND_NTA)) { } else if (command_compare(command, NAMED_COMMAND_NTA)) {
result = named_server_nta(named_g_server, lex, readonly, text); result = named_server_nta(named_g_server, lex, readonly, text);
@ -287,7 +287,7 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
} else if (command_compare(command, NAMED_COMMAND_ZONESTATUS)) { } else if (command_compare(command, NAMED_COMMAND_ZONESTATUS)) {
result = named_server_zonestatus(named_g_server, lex, text); result = named_server_zonestatus(named_g_server, lex, text);
} else { } else {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_WARNING, NAMED_LOGMODULE_CONTROL, ISC_LOG_WARNING,
"unknown control channel command '%s'", command); "unknown control channel command '%s'", command);
result = DNS_R_UNKNOWNCOMMAND; result = DNS_R_UNKNOWNCOMMAND;

View File

@ -225,9 +225,9 @@ shutdown_listener(controllistener_t *listener) {
char socktext[ISC_SOCKADDR_FORMATSIZE]; char socktext[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(&listener->address, socktext, sizeof(socktext)); isc_sockaddr_format(&listener->address, socktext, sizeof(socktext));
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_CONTROL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "stopping command channel on %s",
"stopping command channel on %s", socktext); socktext);
isc_nm_stoplistening(listener->sock); isc_nm_stoplistening(listener->sock);
isc_nmsocket_close(&listener->sock); isc_nmsocket_close(&listener->sock);
@ -272,7 +272,7 @@ control_senddone(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
isc_sockaddr_t peeraddr = isc_nmhandle_peeraddr(handle); isc_sockaddr_t peeraddr = isc_nmhandle_peeraddr(handle);
isc_sockaddr_format(&peeraddr, socktext, sizeof(socktext)); isc_sockaddr_format(&peeraddr, socktext, sizeof(socktext));
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_WARNING, NAMED_LOGMODULE_CONTROL, ISC_LOG_WARNING,
"error sending command response to %s: %s", "error sending command response to %s: %s",
socktext, isc_result_totext(result)); socktext, isc_result_totext(result));
@ -291,9 +291,8 @@ log_invalid(isccc_ccmsg_t *ccmsg, isc_result_t result) {
isc_sockaddr_t peeraddr = isc_nmhandle_peeraddr(ccmsg->handle); isc_sockaddr_t peeraddr = isc_nmhandle_peeraddr(ccmsg->handle);
isc_sockaddr_format(&peeraddr, socktext, sizeof(socktext)); isc_sockaddr_format(&peeraddr, socktext, sizeof(socktext));
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_CONTROL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_ERROR, ISC_LOG_ERROR, "invalid command from %s: %s", socktext,
"invalid command from %s: %s", socktext,
isc_result_totext(result)); isc_result_totext(result));
} }
@ -588,9 +587,8 @@ conn_free(controlconnection_t *conn) {
} }
#endif /* ifdef ENABLE_AFL */ #endif /* ifdef ENABLE_AFL */
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_CONTROL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3), "freeing control connection");
"freeing control connection");
isc_mem_put(listener->mctx, conn, sizeof(*conn)); isc_mem_put(listener->mctx, conn, sizeof(*conn));
@ -601,7 +599,7 @@ static void
newconnection(controllistener_t *listener, isc_nmhandle_t *handle) { newconnection(controllistener_t *listener, isc_nmhandle_t *handle) {
/* Don't create new connection if we are shutting down */ /* Don't create new connection if we are shutting down */
if (listener->shuttingdown) { if (listener->shuttingdown) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_DEBUG(3), NAMED_LOGMODULE_CONTROL, ISC_LOG_DEBUG(3),
"rejected new control connection: %s", "rejected new control connection: %s",
isc_result_totext(ISC_R_SHUTTINGDOWN)); isc_result_totext(ISC_R_SHUTTINGDOWN));
@ -609,9 +607,8 @@ newconnection(controllistener_t *listener, isc_nmhandle_t *handle) {
} }
controlconnection_t *conn = isc_mem_get(listener->mctx, sizeof(*conn)); controlconnection_t *conn = isc_mem_get(listener->mctx, sizeof(*conn));
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_CONTROL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3), "allocate new control connection");
"allocate new control connection");
*conn = (controlconnection_t){ *conn = (controlconnection_t){
.alg = DST_ALG_UNKNOWN, .alg = DST_ALG_UNKNOWN,
@ -648,7 +645,7 @@ control_newconn(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
if (!address_ok(&peeraddr, listener)) { if (!address_ok(&peeraddr, listener)) {
char socktext[ISC_SOCKADDR_FORMATSIZE]; char socktext[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(&peeraddr, socktext, sizeof(socktext)); isc_sockaddr_format(&peeraddr, socktext, sizeof(socktext));
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_WARNING, NAMED_LOGMODULE_CONTROL, ISC_LOG_WARNING,
"rejected command channel message from %s", "rejected command channel message from %s",
socktext); socktext);
@ -760,7 +757,7 @@ register_keys(const cfg_obj_t *control, const cfg_obj_t *keylist,
result = cfgkeylist_find(keylist, keyid->keyname, &keydef); result = cfgkeylist_find(keylist, keyid->keyname, &keydef);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log(control, named_g_lctx, ISC_LOG_WARNING, cfg_obj_log(control, ISC_LOG_WARNING,
"couldn't find key '%s' for use with " "couldn't find key '%s' for use with "
"command channel %s", "command channel %s",
keyid->keyname, socktext); keyid->keyname, socktext);
@ -783,8 +780,7 @@ register_keys(const cfg_obj_t *control, const cfg_obj_t *keylist,
result = named_config_getkeyalgorithm(algstr, &algtype, result = named_config_getkeyalgorithm(algstr, &algtype,
NULL); NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log(control, named_g_lctx, cfg_obj_log(control, ISC_LOG_WARNING,
ISC_LOG_WARNING,
"unsupported algorithm '%s' in " "unsupported algorithm '%s' in "
"key '%s' for use with command " "key '%s' for use with command "
"channel %s", "channel %s",
@ -799,8 +795,7 @@ register_keys(const cfg_obj_t *control, const cfg_obj_t *keylist,
result = isc_base64_decodestring(secretstr, &b); result = isc_base64_decodestring(secretstr, &b);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log(keydef, named_g_lctx, cfg_obj_log(keydef, ISC_LOG_WARNING,
ISC_LOG_WARNING,
"secret for key '%s' on " "secret for key '%s' on "
"command channel %s: %s", "command channel %s: %s",
keyid->keyname, socktext, keyid->keyname, socktext,
@ -834,14 +829,14 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
unsigned int algtype; unsigned int algtype;
isc_buffer_t b; isc_buffer_t b;
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_CONTROL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_INFO, ISC_LOG_INFO, "configuring command channel from '%s'",
"configuring command channel from '%s'", named_g_keyfile); named_g_keyfile);
if (!isc_file_exists(named_g_keyfile)) { if (!isc_file_exists(named_g_keyfile)) {
return (ISC_R_FILENOTFOUND); return (ISC_R_FILENOTFOUND);
} }
CHECK(cfg_parser_create(mctx, named_g_lctx, &pctx)); CHECK(cfg_parser_create(mctx, &pctx));
CHECK(cfg_parse_file(pctx, named_g_keyfile, &cfg_type_rndckey, CHECK(cfg_parse_file(pctx, named_g_keyfile, &cfg_type_rndckey,
&config)); &config));
CHECK(cfg_map_get(config, "key", &key)); CHECK(cfg_map_get(config, "key", &key));
@ -857,7 +852,7 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
CHECK(ISC_R_NOMEMORY); CHECK(ISC_R_NOMEMORY);
} }
CHECK(isccfg_check_key(key, named_g_lctx)); CHECK(isccfg_check_key(key));
(void)cfg_map_get(key, "algorithm", &algobj); (void)cfg_map_get(key, "algorithm", &algobj);
(void)cfg_map_get(key, "secret", &secretobj); (void)cfg_map_get(key, "secret", &secretobj);
@ -868,7 +863,7 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
result = named_config_getkeyalgorithm(algstr, &algtype, NULL); result = named_config_getkeyalgorithm(algstr, &algtype, NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log(key, named_g_lctx, ISC_LOG_WARNING, cfg_obj_log(key, ISC_LOG_WARNING,
"unsupported algorithm '%s' in " "unsupported algorithm '%s' in "
"key '%s' for use with command " "key '%s' for use with command "
"channel", "channel",
@ -881,7 +876,7 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
result = isc_base64_decodestring(secretstr, &b); result = isc_base64_decodestring(secretstr, &b);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log(key, named_g_lctx, ISC_LOG_WARNING, cfg_obj_log(key, ISC_LOG_WARNING,
"secret for key '%s' on command channel: %s", "secret for key '%s' on command channel: %s",
keyid->keyname, isc_result_totext(result)); keyid->keyname, isc_result_totext(result));
goto cleanup; goto cleanup;
@ -1009,12 +1004,12 @@ update_listener(named_controls_t *cp, controllistener_t **listenerp,
* sake of avoiding this message would be too much trouble. * sake of avoiding this message would be too much trouble.
*/ */
if (control != NULL) { if (control != NULL) {
cfg_obj_log(control, named_g_lctx, ISC_LOG_WARNING, cfg_obj_log(control, ISC_LOG_WARNING,
"couldn't install new keys for " "couldn't install new keys for "
"command channel %s: %s", "command channel %s: %s",
socktext, isc_result_totext(result)); socktext, isc_result_totext(result));
} else { } else {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_WARNING, NAMED_LOGMODULE_CONTROL, ISC_LOG_WARNING,
"couldn't install new keys for " "couldn't install new keys for "
"command channel %s: %s", "command channel %s: %s",
@ -1027,9 +1022,8 @@ update_listener(named_controls_t *cp, controllistener_t **listenerp,
*/ */
if (control != NULL && type == isc_socktype_tcp) { if (control != NULL && type == isc_socktype_tcp) {
allow = cfg_tuple_get(control, "allow"); allow = cfg_tuple_get(control, "allow");
result = cfg_acl_fromconfig(allow, config, named_g_lctx, result = cfg_acl_fromconfig(allow, config, aclconfctx,
aclconfctx, listener->mctx, 0, listener->mctx, 0, &new_acl);
&new_acl);
} else { } else {
result = dns_acl_any(listener->mctx, &new_acl); result = dns_acl_any(listener->mctx, &new_acl);
} }
@ -1049,12 +1043,12 @@ update_listener(named_controls_t *cp, controllistener_t **listenerp,
dns_acl_detach(&new_acl); dns_acl_detach(&new_acl);
/* XXXDCL say the old acl is still used? */ /* XXXDCL say the old acl is still used? */
} else if (control != NULL) { } else if (control != NULL) {
cfg_obj_log(control, named_g_lctx, ISC_LOG_WARNING, cfg_obj_log(control, ISC_LOG_WARNING,
"couldn't install new acl for " "couldn't install new acl for "
"command channel %s: %s", "command channel %s: %s",
socktext, isc_result_totext(result)); socktext, isc_result_totext(result));
} else { } else {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_WARNING, NAMED_LOGMODULE_CONTROL, ISC_LOG_WARNING,
"couldn't install new acl for " "couldn't install new acl for "
"command channel %s: %s", "command channel %s: %s",
@ -1101,8 +1095,8 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
const cfg_obj_t *readonly = NULL; const cfg_obj_t *readonly = NULL;
allow = cfg_tuple_get(control, "allow"); allow = cfg_tuple_get(control, "allow");
CHECK(cfg_acl_fromconfig(allow, config, named_g_lctx, CHECK(cfg_acl_fromconfig(allow, config, aclconfctx, mctx, 0,
aclconfctx, mctx, 0, &new_acl)); &new_acl));
readonly = cfg_tuple_get(control, "read-only"); readonly = cfg_tuple_get(control, "read-only");
if (!cfg_obj_isvoid(readonly)) { if (!cfg_obj_isvoid(readonly)) {
@ -1128,7 +1122,7 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
} else { } else {
result = get_rndckey(mctx, &listener->keys); result = get_rndckey(mctx, &listener->keys);
if (result != ISC_R_SUCCESS && control != NULL) { if (result != ISC_R_SUCCESS && control != NULL) {
cfg_obj_log(control, named_g_lctx, ISC_LOG_WARNING, cfg_obj_log(control, ISC_LOG_WARNING,
"couldn't install keys for " "couldn't install keys for "
"command channel %s: %s", "command channel %s: %s",
socktext, isc_result_totext(result)); socktext, isc_result_totext(result));
@ -1146,9 +1140,9 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
&listener->address, control_newconn, listener, 5, &listener->address, control_newconn, listener, 5,
NULL, &listener->sock)); NULL, &listener->sock));
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_CONTROL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "command channel listening on %s",
"command channel listening on %s", socktext); socktext);
*listenerp = listener; *listenerp = listener;
return; return;
@ -1159,11 +1153,11 @@ cleanup:
shuttingdown: shuttingdown:
if (control != NULL) { if (control != NULL) {
cfg_obj_log(control, named_g_lctx, ISC_LOG_WARNING, cfg_obj_log(control, ISC_LOG_WARNING,
"couldn't add command channel %s: %s", socktext, "couldn't add command channel %s: %s", socktext,
isc_result_totext(result)); isc_result_totext(result));
} else { } else {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_NOTICE, NAMED_LOGMODULE_CONTROL, ISC_LOG_NOTICE,
"couldn't add command channel %s: %s", socktext, "couldn't add command channel %s: %s", socktext,
isc_result_totext(result)); isc_result_totext(result));
@ -1208,8 +1202,7 @@ named_controls_configure(named_controls_t *cp, const cfg_obj_t *config,
(void)cfg_map_get(controls, "unix", &unixcontrols); (void)cfg_map_get(controls, "unix", &unixcontrols);
if (unixcontrols != NULL) { if (unixcontrols != NULL) {
cfg_obj_log(controls, named_g_lctx, cfg_obj_log(controls, ISC_LOG_ERROR,
ISC_LOG_ERROR,
"UNIX domain sockets are not " "UNIX domain sockets are not "
"supported"); "supported");
return (ISC_R_FAILURE); return (ISC_R_FAILURE);
@ -1245,8 +1238,7 @@ named_controls_configure(named_controls_t *cp, const cfg_obj_t *config,
isc_sockaddr_format(&addr, socktext, isc_sockaddr_format(&addr, socktext,
sizeof(socktext)); sizeof(socktext));
isc_log_write(named_g_lctx, isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_CONTROL, NAMED_LOGMODULE_CONTROL,
ISC_LOG_DEBUG(9), ISC_LOG_DEBUG(9),
"processing control channel %s", "processing control channel %s",

View File

@ -80,7 +80,7 @@ static void
dlopen_log(int level, const char *fmt, ...) { dlopen_log(int level, const char *fmt, ...) {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, isc_log_vwrite(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ,
ISC_LOG_DEBUG(level), fmt, ap); ISC_LOG_DEBUG(level), fmt, ap);
va_end(ap); va_end(ap);
} }

View File

@ -39,8 +39,8 @@ open_geoip2(const char *dir, const char *dbfile, MMDB_s *mmdb) {
n = snprintf(pathbuf, sizeof(pathbuf), "%s/%s", dir, dbfile); n = snprintf(pathbuf, sizeof(pathbuf), "%s/%s", dir, dbfile);
if (n >= sizeof(pathbuf)) { if (n >= sizeof(pathbuf)) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR,
"GeoIP2 database '%s/%s': path too long", dir, "GeoIP2 database '%s/%s': path too long", dir,
dbfile); dbfile);
return (NULL); return (NULL);
@ -48,14 +48,14 @@ open_geoip2(const char *dir, const char *dbfile, MMDB_s *mmdb) {
ret = MMDB_open(pathbuf, MMDB_MODE_MMAP, mmdb); ret = MMDB_open(pathbuf, MMDB_MODE_MMAP, mmdb);
if (ret == MMDB_SUCCESS) { if (ret == MMDB_SUCCESS) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO, ISC_LOG_INFO, "opened GeoIP2 database '%s'",
"opened GeoIP2 database '%s'", pathbuf); pathbuf);
return (mmdb); return (mmdb);
} }
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1),
"unable to open GeoIP2 database '%s' (status %d)", "unable to open GeoIP2 database '%s' (status %d)",
pathbuf, ret); pathbuf, ret);
@ -79,9 +79,9 @@ named_geoip_load(char *dir) {
#if defined(HAVE_GEOIP2) #if defined(HAVE_GEOIP2)
REQUIRE(dir != NULL); REQUIRE(dir != NULL);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO, ISC_LOG_INFO, "looking for GeoIP2 databases in '%s'",
"looking for GeoIP2 databases in '%s'", dir); dir);
named_g_geoip->country = open_geoip2(dir, "GeoIP2-Country.mmdb", named_g_geoip->country = open_geoip2(dir, "GeoIP2-Country.mmdb",
&geoip_country); &geoip_country);

View File

@ -86,7 +86,6 @@ EXTERN named_server_t *named_g_server INIT(NULL);
/* /*
* Logging. * Logging.
*/ */
EXTERN isc_log_t *named_g_lctx INIT(NULL);
EXTERN isc_logcategory_t *named_g_categories INIT(NULL); EXTERN isc_logcategory_t *named_g_categories INIT(NULL);
EXTERN isc_logmodule_t *named_g_modules INIT(NULL); EXTERN isc_logmodule_t *named_g_modules INIT(NULL);
EXTERN unsigned int named_g_debuglevel INIT(0); EXTERN unsigned int named_g_debuglevel INIT(0);

View File

@ -79,6 +79,3 @@ named_log_setunmatchedcategory(isc_logconfig_t *lcfg);
/*% /*%
* Set up "category unmatched" to go to the right places. * Set up "category unmatched" to go to the right places.
*/ */
void
named_log_shutdown(void) __attribute__((__deprecated__));

View File

@ -55,18 +55,14 @@ named_log_init(bool safe) {
named_g_categories = categories; named_g_categories = categories;
named_g_modules = modules; named_g_modules = modules;
/*
* Setup a logging context.
*/
/* /*
* named-checktool.c:setup_logging() needs to be kept in sync. * named-checktool.c:setup_logging() needs to be kept in sync.
*/ */
isc_log_registercategories(named_g_lctx, named_g_categories); isc_log_registercategories(named_g_categories);
isc_log_registermodules(named_g_lctx, named_g_modules); isc_log_registermodules(named_g_modules);
dns_log_init(named_g_lctx); dns_log_init();
cfg_log_init(named_g_lctx); cfg_log_init();
ns_log_init(named_g_lctx); ns_log_init();
/* /*
* This is not technically needed, as we are calling named_log_init() * This is not technically needed, as we are calling named_log_init()
@ -75,7 +71,7 @@ named_log_init(bool safe) {
* hygiene. * hygiene.
*/ */
rcu_read_lock(); rcu_read_lock();
lcfg = isc_logconfig_get(named_g_lctx); lcfg = isc_logconfig_get();
if (safe) { if (safe) {
named_log_setsafechannels(lcfg); named_log_setsafechannels(lcfg);
} else { } else {
@ -138,7 +134,7 @@ named_log_setdefaultchannels(isc_logconfig_t *lcfg) {
/* /*
* Set the initial debug level. * Set the initial debug level.
*/ */
isc_log_setdebuglevel(named_g_lctx, named_g_debuglevel); isc_log_setdebuglevel(named_g_debuglevel);
} }
void void
@ -153,9 +149,9 @@ named_log_setsafechannels(isc_logconfig_t *lcfg) {
* Setting the debug level to zero should get the output * Setting the debug level to zero should get the output
* discarded a bit faster. * discarded a bit faster.
*/ */
isc_log_setdebuglevel(named_g_lctx, 0); isc_log_setdebuglevel(0);
} else { } else {
isc_log_setdebuglevel(named_g_lctx, named_g_debuglevel); isc_log_setdebuglevel(named_g_debuglevel);
} }
if (named_g_logfile != NULL) { if (named_g_logfile != NULL) {
@ -247,8 +243,3 @@ named_log_setunmatchedcategory(isc_logconfig_t *lcfg) {
NULL); NULL);
return (result); return (result);
} }
void
named_log_shutdown(void) {
/* no-op */
}

View File

@ -50,9 +50,9 @@ category_fromconf(const cfg_obj_t *ccat, isc_logconfig_t *logconfig) {
const cfg_listelt_t *element = NULL; const cfg_listelt_t *element = NULL;
catname = cfg_obj_asstring(cfg_tuple_get(ccat, "name")); catname = cfg_obj_asstring(cfg_tuple_get(ccat, "name"));
category = isc_log_categorybyname(named_g_lctx, catname); category = isc_log_categorybyname(catname);
if (category == NULL) { if (category == NULL) {
cfg_obj_log(ccat, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(ccat, ISC_LOG_ERROR,
"unknown logging category '%s' ignored", catname); "unknown logging category '%s' ignored", catname);
/* /*
* Allow further processing by returning success. * Allow further processing by returning success.
@ -76,7 +76,7 @@ category_fromconf(const cfg_obj_t *ccat, isc_logconfig_t *logconfig) {
result = isc_log_usechannel(logconfig, channelname, category, result = isc_log_usechannel(logconfig, channelname, category,
module); module);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(named_g_lctx, CFG_LOGCATEGORY_CONFIG, isc_log_write(CFG_LOGCATEGORY_CONFIG,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"logging channel '%s': %s", channelname, "logging channel '%s': %s", channelname,
isc_result_totext(result)); isc_result_totext(result));
@ -127,7 +127,7 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
} }
if (i != 1) { if (i != 1) {
cfg_obj_log(channel, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(channel, ISC_LOG_ERROR,
"channel '%s': exactly one of file, syslog, " "channel '%s': exactly one of file, syslog, "
"null, and stderr must be present", "null, and stderr must be present",
channelname); channelname);

View File

@ -161,10 +161,9 @@ named_main_earlywarning(const char *format, ...) {
va_list args; va_list args;
va_start(args, format); va_start(args, format);
if (named_g_lctx != NULL) { if (named_g_categories != NULL) {
isc_log_vwrite(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_vwrite(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_WARNING, format, ISC_LOG_WARNING, format, args);
args);
} else { } else {
fprintf(stderr, "%s: ", program_name); fprintf(stderr, "%s: ", program_name);
vfprintf(stderr, format, args); vfprintf(stderr, format, args);
@ -179,12 +178,11 @@ named_main_earlyfatal(const char *format, ...) {
va_list args; va_list args;
va_start(args, format); va_start(args, format);
if (named_g_lctx != NULL) { if (named_g_categories != NULL) {
isc_log_vwrite(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_vwrite(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL, format, ISC_LOG_CRITICAL, format, args);
args); isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, ISC_LOG_CRITICAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL,
"exiting (due to early fatal error)"); "exiting (due to early fatal error)");
} else { } else {
fprintf(stderr, "%s: ", program_name); fprintf(stderr, "%s: ", program_name);
@ -208,21 +206,20 @@ assertion_failed(const char *file, int line, isc_assertiontype_t type,
* Handle assertion failures. * Handle assertion failures.
*/ */
if (named_g_lctx != NULL) { if (named_g_categories != NULL) {
/* /*
* Reset the assertion callback in case it is the log * Reset the assertion callback in case it is the log
* routines causing the assertion. * routines causing the assertion.
*/ */
isc_assertion_setcallback(NULL); isc_assertion_setcallback(NULL);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL, ISC_LOG_CRITICAL, "%s:%d: %s(%s) failed", file,
"%s:%d: %s(%s) failed", file, line, line, isc_assertion_typetotext(type), cond);
isc_assertion_typetotext(type), cond); isc_backtrace_log(NAMED_LOGCATEGORY_GENERAL,
isc_backtrace_log(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL); NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL, ISC_LOG_CRITICAL,
"exiting (due to assertion failure)"); "exiting (due to assertion failure)");
} else { } else {
fprintf(stderr, "%s:%d: %s(%s) failed\n", file, line, fprintf(stderr, "%s:%d: %s(%s) failed\n", file, line,
@ -247,21 +244,20 @@ library_fatal_error(const char *file, int line, const char *func,
* Handle isc_error_fatal() calls from our libraries. * Handle isc_error_fatal() calls from our libraries.
*/ */
if (named_g_lctx != NULL) { if (named_g_categories != NULL) {
/* /*
* Reset the error callback in case it is the log * Reset the error callback in case it is the log
* routines causing the assertion. * routines causing the assertion.
*/ */
isc_error_setfatal(NULL); isc_error_setfatal(NULL);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL, ISC_LOG_CRITICAL,
"%s:%d:%s(): fatal error: ", file, line, func); "%s:%d:%s(): fatal error: ", file, line, func);
isc_log_vwrite(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_vwrite(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL, format, ISC_LOG_CRITICAL, format, args);
args); isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, ISC_LOG_CRITICAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL,
"exiting (due to fatal error in library)"); "exiting (due to fatal error in library)");
} else { } else {
fprintf(stderr, "%s:%d:%s(): fatal error: ", file, line, func); fprintf(stderr, "%s:%d:%s(): fatal error: ", file, line, func);
@ -288,14 +284,13 @@ library_unexpected_error(const char *file, int line, const char *func,
* Handle isc_error_unexpected() calls from our libraries. * Handle isc_error_unexpected() calls from our libraries.
*/ */
if (named_g_lctx != NULL) { if (named_g_categories != NULL) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_ERROR, ISC_LOG_ERROR,
"%s:%d:%s(): unexpected error: ", file, line, "%s:%d:%s(): unexpected error: ", file, line,
func); func);
isc_log_vwrite(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_vwrite(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_ERROR, format, ISC_LOG_ERROR, format, args);
args);
} else { } else {
fprintf(stderr, "%s:%d:%s(): fatal error: ", file, line, func); fprintf(stderr, "%s:%d:%s(): fatal error: ", file, line, func);
vfprintf(stderr, format, args); vfprintf(stderr, format, args);
@ -510,9 +505,8 @@ list_hmac_algorithms(isc_buffer_t *b) {
static void static void
logit(isc_buffer_t *b) { logit(isc_buffer_t *b) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, "%.*s", ISC_LOG_NOTICE, "%.*s", (int)isc_buffer_usedlength(b),
(int)isc_buffer_usedlength(b),
(char *)isc_buffer_base(b)); (char *)isc_buffer_base(b));
} }
@ -657,7 +651,7 @@ printversion(bool verbose) {
#define RTC(x) RUNTIME_CHECK((x) == ISC_R_SUCCESS) #define RTC(x) RUNTIME_CHECK((x) == ISC_R_SUCCESS)
isc_mem_t *mctx = NULL; isc_mem_t *mctx = NULL;
isc_mem_create(&mctx); isc_mem_create(&mctx);
RTC(cfg_parser_create(mctx, named_g_lctx, &parser)); RTC(cfg_parser_create(mctx, &parser));
RTC(named_config_parsedefaults(parser, &config)); RTC(named_config_parsedefaults(parser, &config));
RTC(cfg_map_get(config, "options", &defaults)); RTC(cfg_map_get(config, "options", &defaults));
RTC(cfg_map_get(defaults, "geoip-directory", &obj)); RTC(cfg_map_get(defaults, "geoip-directory", &obj));
@ -1017,11 +1011,11 @@ create_managers(void) {
named_g_cpus = named_g_cpus_detected; named_g_cpus = named_g_cpus_detected;
} }
isc_log_write( isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
named_g_lctx, NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, ISC_LOG_INFO, "found %u CPU%s, using %u worker thread%s",
ISC_LOG_INFO, "found %u CPU%s, using %u worker thread%s", named_g_cpus_detected,
named_g_cpus_detected, named_g_cpus_detected == 1 ? "" : "s", named_g_cpus_detected == 1 ? "" : "s", named_g_cpus,
named_g_cpus, named_g_cpus == 1 ? "" : "s"); named_g_cpus == 1 ? "" : "s");
isc_managers_create(&named_g_mctx, named_g_cpus, &named_g_loopmgr, isc_managers_create(&named_g_mctx, named_g_cpus, &named_g_loopmgr,
&named_g_netmgr); &named_g_netmgr);
@ -1101,141 +1095,129 @@ setup(void) {
named_os_daemonize(); named_os_daemonize();
} }
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "starting %s%s <id:%s>", PACKAGE_STRING,
"starting %s%s <id:%s>", PACKAGE_STRING,
PACKAGE_DESCRIPTION, PACKAGE_SRCID); PACKAGE_DESCRIPTION, PACKAGE_SRCID);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, "running on %s", ISC_LOG_NOTICE, "running on %s", named_os_uname());
named_os_uname());
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, "built with %s", ISC_LOG_NOTICE, "built with %s", PACKAGE_CONFIGARGS);
PACKAGE_CONFIGARGS);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "running as: %s%s%s", program_name,
"running as: %s%s%s", program_name, saved_command_line, saved_command_line, ellipsis);
ellipsis);
#ifdef __clang__ #ifdef __clang__
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "compiled by CLANG %s", __VERSION__);
"compiled by CLANG %s", __VERSION__);
#else /* ifdef __clang__ */ #else /* ifdef __clang__ */
#if defined(__ICC) || defined(__INTEL_COMPILER) #if defined(__ICC) || defined(__INTEL_COMPILER)
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "compiled by ICC %s", __VERSION__);
"compiled by ICC %s", __VERSION__);
#else /* if defined(__ICC) || defined(__INTEL_COMPILER) */ #else /* if defined(__ICC) || defined(__INTEL_COMPILER) */
#ifdef __GNUC__ #ifdef __GNUC__
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "compiled by GCC %s", __VERSION__);
"compiled by GCC %s", __VERSION__);
#endif /* ifdef __GNUC__ */ #endif /* ifdef __GNUC__ */
#endif /* if defined(__ICC) || defined(__INTEL_COMPILER) */ #endif /* if defined(__ICC) || defined(__INTEL_COMPILER) */
#endif /* ifdef __clang__ */ #endif /* ifdef __clang__ */
#ifdef __SUNPRO_C #ifdef __SUNPRO_C
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "compiled by Solaris Studio %x",
"compiled by Solaris Studio %x", __SUNPRO_C); __SUNPRO_C);
#endif /* ifdef __SUNPRO_C */ #endif /* ifdef __SUNPRO_C */
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "compiled with OpenSSL version: %s",
"compiled with OpenSSL version: %s",
OPENSSL_VERSION_TEXT); OPENSSL_VERSION_TEXT);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "linked to OpenSSL version: %s",
"linked to OpenSSL version: %s",
OpenSSL_version(OPENSSL_VERSION)); OpenSSL_version(OPENSSL_VERSION));
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "compiled with libuv version: %d.%d.%d",
"compiled with libuv version: %d.%d.%d", UV_VERSION_MAJOR, UV_VERSION_MAJOR, UV_VERSION_MINOR, UV_VERSION_PATCH);
UV_VERSION_MINOR, UV_VERSION_PATCH); isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, ISC_LOG_NOTICE, "linked to libuv version: %s",
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, uv_version_string());
"linked to libuv version: %s", uv_version_string()); isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, ISC_LOG_NOTICE, "compiled with %s version: %s",
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, RCU_FLAVOR, RCU_VERSION);
"compiled with %s version: %s", RCU_FLAVOR, RCU_VERSION);
#if defined(JEMALLOC_VERSION) #if defined(JEMALLOC_VERSION)
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"compiled with jemalloc version: %u.%u.%u", "compiled with jemalloc version: %u.%u.%u",
JEMALLOC_VERSION_MAJOR, JEMALLOC_VERSION_MINOR, JEMALLOC_VERSION_MAJOR, JEMALLOC_VERSION_MINOR,
JEMALLOC_VERSION_BUGFIX); JEMALLOC_VERSION_BUGFIX);
#elif defined(M_VERSION) #elif defined(M_VERSION)
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"compiled with system jemalloc version: %u", M_VERSION); "compiled with system jemalloc version: %u", M_VERSION);
#endif #endif
#if HAVE_LIBNGHTTP2 #if HAVE_LIBNGHTTP2
nghttp2_info *nginfo = NULL; nghttp2_info *nginfo = NULL;
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "compiled with libnghttp2 version: %s",
"compiled with libnghttp2 version: %s", NGHTTP2_VERSION); NGHTTP2_VERSION);
nginfo = nghttp2_version(1); nginfo = nghttp2_version(1);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "linked to libnghttp2 version: %s",
"linked to libnghttp2 version: %s", nginfo->version_str); nginfo->version_str);
#endif #endif
#ifdef HAVE_LIBXML2 #ifdef HAVE_LIBXML2
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "compiled with libxml2 version: %s",
"compiled with libxml2 version: %s",
LIBXML_DOTTED_VERSION); LIBXML_DOTTED_VERSION);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "linked to libxml2 version: %s",
"linked to libxml2 version: %s", xmlParserVersion); xmlParserVersion);
#endif /* ifdef HAVE_LIBXML2 */ #endif /* ifdef HAVE_LIBXML2 */
#if defined(HAVE_JSON_C) #if defined(HAVE_JSON_C)
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "compiled with json-c version: %s",
"compiled with json-c version: %s", JSON_C_VERSION); JSON_C_VERSION);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "linked to json-c version: %s",
"linked to json-c version: %s", json_c_version()); json_c_version());
#endif /* if defined(HAVE_JSON_C) */ #endif /* if defined(HAVE_JSON_C) */
#if defined(HAVE_ZLIB) && defined(ZLIB_VERSION) #if defined(HAVE_ZLIB) && defined(ZLIB_VERSION)
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "compiled with zlib version: %s",
"compiled with zlib version: %s", ZLIB_VERSION); ZLIB_VERSION);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "linked to zlib version: %s",
"linked to zlib version: %s", zlibVersion()); zlibVersion());
#endif /* if defined(HAVE_ZLIB) && defined(ZLIB_VERSION) */ #endif /* if defined(HAVE_ZLIB) && defined(ZLIB_VERSION) */
#if defined(HAVE_GEOIP2) #if defined(HAVE_GEOIP2)
/* Unfortunately, no version define on link time */ /* Unfortunately, no version define on link time */
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "linked to maxminddb version: %s",
"linked to maxminddb version: %s", MMDB_lib_version()); MMDB_lib_version());
#endif /* if defined(HAVE_GEOIP2) */ #endif /* if defined(HAVE_GEOIP2) */
#if defined(HAVE_DNSTAP) #if defined(HAVE_DNSTAP)
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "compiled with protobuf-c version: %s",
"compiled with protobuf-c version: %s",
PROTOBUF_C_VERSION); PROTOBUF_C_VERSION);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "linked to protobuf-c version: %s",
"linked to protobuf-c version: %s", protobuf_c_version()); protobuf_c_version());
#endif /* if defined(HAVE_DNSTAP) */ #endif /* if defined(HAVE_DNSTAP) */
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"----------------------------------------------------"); "----------------------------------------------------");
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"BIND 9 is maintained by Internet Systems Consortium,"); "BIND 9 is maintained by Internet Systems Consortium,");
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"Inc. (ISC), a non-profit 501(c)(3) public-benefit "); "Inc. (ISC), a non-profit 501(c)(3) public-benefit ");
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"corporation. Support and training for BIND 9 are "); "corporation. Support and training for BIND 9 are ");
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"available at https://www.isc.org/support"); "available at https://www.isc.org/support");
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"----------------------------------------------------"); "----------------------------------------------------");
/* /*
@ -1367,9 +1349,8 @@ cleanup(void) {
*/ */
dlz_dlopen_clear(); dlz_dlopen_clear();
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, "exiting"); ISC_LOG_NOTICE, "exiting");
named_log_shutdown();
} }
static char *memstats = NULL; static char *memstats = NULL;

View File

@ -626,8 +626,8 @@ named_os_adjustnofile(void) {
rlim_old = rl.rlim_cur; rlim_old = rl.rlim_cur;
if (rl.rlim_cur == rl.rlim_max) { if (rl.rlim_cur == rl.rlim_max) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"the limit on open files is already at the " "the limit on open files is already at the "
"maximum allowed value: " "maximum allowed value: "
"%" PRIu64, "%" PRIu64,
@ -641,8 +641,8 @@ named_os_adjustnofile(void) {
goto fail; goto fail;
} }
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"adjusted limit on open files from " "adjusted limit on open files from "
"%" PRIu64 " to " "%" PRIu64 " to "
"%" PRIu64, "%" PRIu64,

File diff suppressed because it is too large Load Diff

View File

@ -936,9 +936,8 @@ dump_counters(isc_statsformat_t type, void *arg, const char *category,
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
#ifdef HAVE_LIBXML2 #ifdef HAVE_LIBXML2
cleanup: cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR, "failed at dump_counters()");
"failed at dump_counters()");
return (ISC_R_FAILURE); return (ISC_R_FAILURE);
#endif /* ifdef HAVE_LIBXML2 */ #endif /* ifdef HAVE_LIBXML2 */
} }
@ -999,9 +998,8 @@ rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
return; return;
#ifdef HAVE_LIBXML2 #ifdef HAVE_LIBXML2
cleanup: cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR, "failed at rdtypestat_dump()");
"failed at rdtypestat_dump()");
dumparg->result = ISC_R_FAILURE; dumparg->result = ISC_R_FAILURE;
return; return;
#endif /* ifdef HAVE_LIBXML2 */ #endif /* ifdef HAVE_LIBXML2 */
@ -1088,9 +1086,8 @@ rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
return; return;
#ifdef HAVE_LIBXML2 #ifdef HAVE_LIBXML2
cleanup: cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR, "failed at rdatasetstats_dump()");
"failed at rdatasetstats_dump()");
dumparg->result = ISC_R_FAILURE; dumparg->result = ISC_R_FAILURE;
#endif /* ifdef HAVE_LIBXML2 */ #endif /* ifdef HAVE_LIBXML2 */
} }
@ -1143,9 +1140,8 @@ opcodestat_dump(dns_opcode_t code, uint64_t val, void *arg) {
#ifdef HAVE_LIBXML2 #ifdef HAVE_LIBXML2
cleanup: cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR, "failed at opcodestat_dump()");
"failed at opcodestat_dump()");
dumparg->result = ISC_R_FAILURE; dumparg->result = ISC_R_FAILURE;
return; return;
#endif /* ifdef HAVE_LIBXML2 */ #endif /* ifdef HAVE_LIBXML2 */
@ -1199,9 +1195,8 @@ rcodestat_dump(dns_rcode_t code, uint64_t val, void *arg) {
#ifdef HAVE_LIBXML2 #ifdef HAVE_LIBXML2
cleanup: cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR, "failed at rcodestat_dump()");
"failed at rcodestat_dump()");
dumparg->result = ISC_R_FAILURE; dumparg->result = ISC_R_FAILURE;
return; return;
#endif /* ifdef HAVE_LIBXML2 */ #endif /* ifdef HAVE_LIBXML2 */
@ -1256,9 +1251,8 @@ dnssecsignstat_dump(uint32_t kval, uint64_t val, void *arg) {
return; return;
#ifdef HAVE_LIBXML2 #ifdef HAVE_LIBXML2
cleanup: cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR, "failed at dnssecsignstat_dump()");
"failed at dnssecsignstat_dump()");
dumparg->result = ISC_R_FAILURE; dumparg->result = ISC_R_FAILURE;
return; return;
#endif /* ifdef HAVE_LIBXML2 */ #endif /* ifdef HAVE_LIBXML2 */
@ -1452,9 +1446,8 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
cleanup: cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR, "Failed at zone_xmlrender()");
"Failed at zone_xmlrender()");
return (ISC_R_FAILURE); return (ISC_R_FAILURE);
} }
@ -1725,9 +1718,8 @@ cleanup:
dns_xfrin_detach(&xfr); dns_xfrin_detach(&xfr);
} }
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR, "Failed at xfrin_xmlrender()");
"Failed at xfrin_xmlrender()");
return (ISC_R_FAILURE); return (ISC_R_FAILURE);
} }
@ -2134,9 +2126,8 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
cleanup: cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR, "failed generating XML response");
"failed generating XML response");
if (writer != NULL) { if (writer != NULL) {
xmlFreeTextWriter(writer); xmlFreeTextWriter(writer);
} }
@ -2173,9 +2164,8 @@ render_xml(uint32_t flags, void *arg, unsigned int *retcode,
*freecb = wrap_xmlfree; *freecb = wrap_xmlfree;
*freecb_args = NULL; *freecb_args = NULL;
} else { } else {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR, "failed at rendering XML()");
"failed at rendering XML()");
} }
return (result); return (result);
@ -3376,9 +3366,8 @@ render_json(uint32_t flags, void *arg, unsigned int *retcode,
*freecb = wrap_jsonfree; *freecb = wrap_jsonfree;
*freecb_args = bindstats; *freecb_args = bindstats;
} else { } else {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR, "failed at rendering JSON()");
"failed at rendering JSON()");
} }
return (result); return (result);
@ -3534,9 +3523,9 @@ static void
shutdown_listener(named_statschannel_t *listener) { shutdown_listener(named_statschannel_t *listener) {
char socktext[ISC_SOCKADDR_FORMATSIZE]; char socktext[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(&listener->address, socktext, sizeof(socktext)); isc_sockaddr_format(&listener->address, socktext, sizeof(socktext));
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "stopping statistics channel on %s",
"stopping statistics channel on %s", socktext); socktext);
isc_httpdmgr_shutdown(&listener->httpdmgr); isc_httpdmgr_shutdown(&listener->httpdmgr);
} }
@ -3565,9 +3554,9 @@ client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
UNLOCK(&listener->lock); UNLOCK(&listener->lock);
isc_sockaddr_format(fromaddr, socktext, sizeof(socktext)); isc_sockaddr_format(fromaddr, socktext, sizeof(socktext));
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING, ISC_LOG_WARNING, "rejected statistics connection from %s",
"rejected statistics connection from %s", socktext); socktext);
return (false); return (false);
} }
@ -3605,9 +3594,8 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
allow = cfg_tuple_get(listen_params, "allow"); allow = cfg_tuple_get(listen_params, "allow");
if (allow != NULL && cfg_obj_islist(allow)) { if (allow != NULL && cfg_obj_islist(allow)) {
result = cfg_acl_fromconfig(allow, config, named_g_lctx, result = cfg_acl_fromconfig(allow, config, aclconfctx,
aclconfctx, listener->mctx, 0, listener->mctx, 0, &new_acl);
&new_acl);
} else { } else {
result = dns_acl_any(listener->mctx, &new_acl); result = dns_acl_any(listener->mctx, &new_acl);
} }
@ -3689,9 +3677,9 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
server); server);
*listenerp = listener; *listenerp = listener;
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "statistics channel listening on %s",
"statistics channel listening on %s", socktext); socktext);
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
@ -3733,9 +3721,8 @@ update_listener(named_server_t *server, named_statschannel_t **listenerp,
*/ */
allow = cfg_tuple_get(listen_params, "allow"); allow = cfg_tuple_get(listen_params, "allow");
if (allow != NULL && cfg_obj_islist(allow)) { if (allow != NULL && cfg_obj_islist(allow)) {
result = cfg_acl_fromconfig(allow, config, named_g_lctx, result = cfg_acl_fromconfig(allow, config, aclconfctx,
aclconfctx, listener->mctx, 0, listener->mctx, 0, &new_acl);
&new_acl);
} else { } else {
result = dns_acl_any(listener->mctx, &new_acl); result = dns_acl_any(listener->mctx, &new_acl);
} }
@ -3749,7 +3736,7 @@ update_listener(named_server_t *server, named_statschannel_t **listenerp,
UNLOCK(&listener->lock); UNLOCK(&listener->lock);
} else { } else {
cfg_obj_log(listen_params, named_g_lctx, ISC_LOG_WARNING, cfg_obj_log(listen_params, ISC_LOG_WARNING,
"couldn't install new acl for " "couldn't install new acl for "
"statistics channel %s: %s", "statistics channel %s: %s",
socktext, isc_result_totext(result)); socktext, isc_result_totext(result));
@ -3786,20 +3773,20 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
*/ */
if (statschannellist != NULL) { if (statschannellist != NULL) {
#ifndef EXTENDED_STATS #ifndef EXTENDED_STATS
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING, ISC_LOG_WARNING,
"statistics-channels specified but not effective " "statistics-channels specified but not effective "
"due to missing XML and/or JSON library"); "due to missing XML and/or JSON library");
#else /* EXTENDED_STATS */ #else /* EXTENDED_STATS */
#ifndef HAVE_LIBXML2 #ifndef HAVE_LIBXML2
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING, ISC_LOG_WARNING,
"statistics-channels: XML library missing, " "statistics-channels: XML library missing, "
"only JSON stats will be available"); "only JSON stats will be available");
#endif /* !HAVE_LIBXML2 */ #endif /* !HAVE_LIBXML2 */
#ifndef HAVE_JSON_C #ifndef HAVE_JSON_C
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING, ISC_LOG_WARNING,
"statistics-channels: JSON library missing, " "statistics-channels: JSON library missing, "
"only XML stats will be available"); "only XML stats will be available");
#endif /* !HAVE_JSON_C */ #endif /* !HAVE_JSON_C */
@ -3838,8 +3825,7 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
isc_sockaddr_format(&addr, socktext, isc_sockaddr_format(&addr, socktext,
sizeof(socktext)); sizeof(socktext));
isc_log_write(named_g_lctx, isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, NAMED_LOGMODULE_SERVER,
ISC_LOG_DEBUG(9), ISC_LOG_DEBUG(9),
"processing statistics " "processing statistics "
@ -3870,7 +3856,6 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
if (r != ISC_R_SUCCESS) { if (r != ISC_R_SUCCESS) {
cfg_obj_log( cfg_obj_log(
listen_params, listen_params,
named_g_lctx,
ISC_LOG_WARNING, ISC_LOG_WARNING,
"couldn't allocate " "couldn't allocate "
"statistics channel" "statistics channel"

View File

@ -38,9 +38,9 @@
} while (0) } while (0)
#include <named/log.h> #include <named/log.h>
#define LOG(msg) \ #define LOG(msg) \
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, \ isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, \
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, "%s", msg) ISC_LOG_ERROR, "%s", msg)
isc_result_t isc_result_t
named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx, named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,

View File

@ -133,8 +133,7 @@ add_doh_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
failure: failure:
cfg_obj_log(doh, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(doh, ISC_LOG_ERROR, "configuring DoH '%s': %s", dohid,
"configuring DoH '%s': %s", dohid,
isc_result_totext(result)); isc_result_totext(result));
return (result); return (result);
@ -187,8 +186,7 @@ add_tls_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
failure: failure:
cfg_obj_log(tls, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(tls, ISC_LOG_ERROR, "configuring tls '%s': %s", tlsid,
"configuring tls '%s': %s", tlsid,
isc_result_totext(result)); isc_result_totext(result));
return (result); return (result);

View File

@ -85,7 +85,7 @@ add_initial_keys(const cfg_obj_t *list, dns_tsigkeyring_t *ring,
if (named_config_getkeyalgorithm(algstr, &alg, &bits) != if (named_config_getkeyalgorithm(algstr, &alg, &bits) !=
ISC_R_SUCCESS) ISC_R_SUCCESS)
{ {
cfg_obj_log(algobj, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(algobj, ISC_LOG_ERROR,
"key '%s': has a " "key '%s': has a "
"unsupported algorithm '%s'", "unsupported algorithm '%s'",
keyid, algstr); keyid, algstr);
@ -129,8 +129,8 @@ failure:
if (secret != NULL) { if (secret != NULL) {
isc_mem_put(mctx, secret, secretalloc); isc_mem_put(mctx, secret, secretalloc);
} }
cfg_obj_log(key, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(key, ISC_LOG_ERROR, "configuring key '%s': %s", keyid,
"configuring key '%s': %s", keyid, isc_result_totext(ret)); isc_result_totext(ret));
return (ret); return (ret);
} }

View File

@ -175,8 +175,8 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
} }
parse_acl: parse_acl:
result = cfg_acl_fromconfig(aclobj, config, named_g_lctx, actx, result = cfg_acl_fromconfig(aclobj, config, actx, named_g_mctx, 0,
named_g_mctx, 0, &acl); &acl);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
return (result); return (result);
} }
@ -262,7 +262,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
result = dns_name_fromtext(dns_fixedname_name(&fident), &b, result = dns_name_fromtext(dns_fixedname_name(&fident), &b,
dns_rootname, 0, NULL); dns_rootname, 0, NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log(identity, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(identity, ISC_LOG_ERROR,
"'%s' is not a valid name", str); "'%s' is not a valid name", str);
goto cleanup; goto cleanup;
} }
@ -278,8 +278,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
result = dns_name_fromtext(dns_fixedname_name(&fname), result = dns_name_fromtext(dns_fixedname_name(&fname),
&b, dns_rootname, 0, NULL); &b, dns_rootname, 0, NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log(identity, named_g_lctx, cfg_obj_log(identity, ISC_LOG_ERROR,
ISC_LOG_ERROR,
"'%s' is not a valid name", str); "'%s' is not a valid name", str);
goto cleanup; goto cleanup;
} }
@ -315,8 +314,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
if (max > 0xffff || end[0] != /*(*/ ')' || if (max > 0xffff || end[0] != /*(*/ ')' ||
end[1] != 0) end[1] != 0)
{ {
cfg_obj_log(identity, named_g_lctx, cfg_obj_log(identity, ISC_LOG_ERROR,
ISC_LOG_ERROR,
"'%s' is not a valid count", "'%s' is not a valid count",
bracket); bracket);
isc_mem_cput(mctx, types, n, isc_mem_cput(mctx, types, n,
@ -330,8 +328,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
result = dns_rdatatype_fromtext(&types[i++].type, &r); result = dns_rdatatype_fromtext(&types[i++].type, &r);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log(identity, named_g_lctx, cfg_obj_log(identity, ISC_LOG_ERROR,
ISC_LOG_ERROR,
"'%.*s' is not a valid type", "'%.*s' is not a valid type",
(int)r.length, str); (int)r.length, str);
isc_mem_cput(mctx, types, n, sizeof(*types)); isc_mem_cput(mctx, types, n, sizeof(*types));
@ -357,7 +354,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
dns_ssuruletype_t any = { dns_rdatatype_any, 0 }; dns_ssuruletype_t any = { dns_rdatatype_any, 0 };
if (named_g_server->session_keyname == NULL) { if (named_g_server->session_keyname == NULL) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"failed to enable auto DDNS policy " "failed to enable auto DDNS policy "
"for zone %s: session key not found", "for zone %s: session key not found",
@ -415,14 +412,14 @@ configure_staticstub_serveraddrs(const cfg_obj_t *zconfig, dns_zone_t *zone,
sa = cfg_obj_assockaddr(address); sa = cfg_obj_assockaddr(address);
if (isc_sockaddr_getport(sa) != 0) { if (isc_sockaddr_getport(sa) != 0) {
cfg_obj_log(zconfig, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(zconfig, ISC_LOG_ERROR,
"port is not configurable for " "port is not configurable for "
"static stub server-addresses"); "static stub server-addresses");
return (ISC_R_FAILURE); return (ISC_R_FAILURE);
} }
isc_netaddr_fromsockaddr(&na, sa); isc_netaddr_fromsockaddr(&na, sa);
if (isc_netaddr_getzone(&na) != 0) { if (isc_netaddr_getzone(&na) != 0) {
cfg_obj_log(zconfig, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(zconfig, ISC_LOG_ERROR,
"scoped address is not allowed " "scoped address is not allowed "
"for static stub " "for static stub "
"server-addresses"); "server-addresses");
@ -508,14 +505,14 @@ configure_staticstub_servernames(const cfg_obj_t *zconfig, dns_zone_t *zone,
isc_buffer_add(&b, strlen(str)); isc_buffer_add(&b, strlen(str));
result = dns_name_fromtext(nsname, &b, dns_rootname, 0, NULL); result = dns_name_fromtext(nsname, &b, dns_rootname, 0, NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log(zconfig, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(zconfig, ISC_LOG_ERROR,
"server-name '%s' is not a valid " "server-name '%s' is not a valid "
"name", "name",
str); str);
return (result); return (result);
} }
if (dns_name_issubdomain(nsname, dns_zone_getorigin(zone))) { if (dns_name_issubdomain(nsname, dns_zone_getorigin(zone))) {
cfg_obj_log(zconfig, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(zconfig, ISC_LOG_ERROR,
"server-name '%s' must not be a " "server-name '%s' must not be a "
"subdomain of zone name '%s'", "subdomain of zone name '%s'",
str, zname); str, zname);
@ -602,8 +599,8 @@ configure_staticstub(const cfg_obj_t *zconfig, dns_zone_t *zone,
* to trigger delegation. * to trigger delegation.
*/ */
if (ISC_LIST_EMPTY(rdatalist_ns.rdata)) { if (ISC_LIST_EMPTY(rdatalist_ns.rdata)) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR,
"No NS record is configured for a " "No NS record is configured for a "
"static-stub zone '%s'", "static-stub zone '%s'",
zname); zname);
@ -854,7 +851,7 @@ process_notifytype(dns_notifytype_t ntype, dns_zonetype_t ztype,
* hierarchy supplied in 'maps'. * hierarchy supplied in 'maps'.
*/ */
if (named_config_get(maps, "notify", &obj) == ISC_R_SUCCESS) { if (named_config_get(maps, "notify", &obj) == ISC_R_SUCCESS) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_INFO, cfg_obj_log(obj, ISC_LOG_INFO,
"'notify explicit;' will be used for mirror zone " "'notify explicit;' will be used for mirror zone "
"'%s'", "'%s'",
zname); zname);
@ -975,7 +972,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
size_t len; size_t len;
if (cpval != default_dbtype) { if (cpval != default_dbtype) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"zone '%s': both 'database' and 'dlz' " "zone '%s': both 'database' and 'dlz' "
"specified", "specified",
@ -1018,9 +1015,9 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
if (ztype == dns_zone_primary && cpval == default_dbtype && if (ztype == dns_zone_primary && cpval == default_dbtype &&
filename == NULL) filename == NULL)
{ {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, ISC_LOG_ERROR, "zone '%s': 'file' not specified",
"zone '%s': 'file' not specified", zname); zname);
CHECK(ISC_R_FAILURE); CHECK(ISC_R_FAILURE);
} }
@ -1049,7 +1046,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
const char *masterstylestr = cfg_obj_asstring(obj); const char *masterstylestr = cfg_obj_asstring(obj);
if (masterformat != dns_masterformat_text) { if (masterformat != dns_masterformat_text) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(obj, ISC_LOG_ERROR,
"zone '%s': 'masterfile-style' " "zone '%s': 'masterfile-style' "
"can only be used with " "can only be used with "
"'masterfile-format text'", "'masterfile-format text'",
@ -1233,8 +1230,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
&kasp); &kasp);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
cfg_obj_log( cfg_obj_log(
obj, named_g_lctx, obj, ISC_LOG_ERROR,
ISC_LOG_ERROR,
"dnssec-policy '%s' not found ", "dnssec-policy '%s' not found ",
kaspname); kaspname);
CHECK(result); CHECK(result);
@ -1360,7 +1356,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
} else { } else {
uint64_t value = cfg_obj_asuint64(obj); uint64_t value = cfg_obj_asuint64(obj);
if (value > DNS_JOURNAL_SIZE_MAX) { if (value > DNS_JOURNAL_SIZE_MAX) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(obj, ISC_LOG_ERROR,
"'max-journal-size " "'max-journal-size "
"%" PRId64 "' " "%" PRId64 "' "
"is too large", "is too large",
@ -1505,7 +1501,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
} else { } else {
uint64_t value = cfg_obj_asuint64(obj); uint64_t value = cfg_obj_asuint64(obj);
if (value > DNS_JOURNAL_SIZE_MAX) { if (value > DNS_JOURNAL_SIZE_MAX) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_ERROR, cfg_obj_log(obj, ISC_LOG_ERROR,
"'max-journal-size " "'max-journal-size "
"%" PRId64 "' " "%" PRId64 "' "
"is too large", "is too large",
@ -1546,7 +1542,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
updateacl = dns_zone_getupdateacl(mayberaw); updateacl = dns_zone_getupdateacl(mayberaw);
if (updateacl != NULL && dns_acl_isinsecure(updateacl)) { if (updateacl != NULL && dns_acl_isinsecure(updateacl)) {
isc_log_write(named_g_lctx, DNS_LOGCATEGORY_SECURITY, isc_log_write(DNS_LOGCATEGORY_SECURITY,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING, NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"zone '%s' allows unsigned updates " "zone '%s' allows unsigned updates "
"from remote hosts, which is insecure", "from remote hosts, which is insecure",

View File

@ -123,7 +123,6 @@ static bool usegsstsig = false;
static bool local_only = false; static bool local_only = false;
static isc_nm_t *netmgr = NULL; static isc_nm_t *netmgr = NULL;
static isc_loopmgr_t *loopmgr = NULL; static isc_loopmgr_t *loopmgr = NULL;
static isc_log_t *glctx = NULL;
static isc_mem_t *gmctx = NULL; static isc_mem_t *gmctx = NULL;
static dns_dispatchmgr_t *dispatchmgr = NULL; static dns_dispatchmgr_t *dispatchmgr = NULL;
static dns_requestmgr_t *requestmgr = NULL; static dns_requestmgr_t *requestmgr = NULL;
@ -559,7 +558,7 @@ failure:
* Get a key from a named.conf format keyfile * Get a key from a named.conf format keyfile
*/ */
static isc_result_t static isc_result_t
read_sessionkey(isc_mem_t *mctx, isc_log_t *lctx) { read_sessionkey(isc_mem_t *mctx) {
cfg_parser_t *pctx = NULL; cfg_parser_t *pctx = NULL;
cfg_obj_t *sessionkey = NULL; cfg_obj_t *sessionkey = NULL;
const cfg_obj_t *key = NULL; const cfg_obj_t *key = NULL;
@ -575,7 +574,7 @@ read_sessionkey(isc_mem_t *mctx, isc_log_t *lctx) {
return (ISC_R_FILENOTFOUND); return (ISC_R_FILENOTFOUND);
} }
result = cfg_parser_create(mctx, lctx, &pctx); result = cfg_parser_create(mctx, &pctx);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
goto cleanup; goto cleanup;
} }
@ -622,7 +621,7 @@ cleanup:
} }
static void static void
setup_keyfile(isc_mem_t *mctx, isc_log_t *lctx) { setup_keyfile(isc_mem_t *mctx) {
dst_key_t *dstkey = NULL; dst_key_t *dstkey = NULL;
isc_result_t result; isc_result_t result;
dst_algorithm_t hmac_alg = DST_ALG_UNKNOWN; dst_algorithm_t hmac_alg = DST_ALG_UNKNOWN;
@ -639,7 +638,7 @@ setup_keyfile(isc_mem_t *mctx, isc_log_t *lctx) {
/* If that didn't work, try reading it as a session.key keyfile */ /* If that didn't work, try reading it as a session.key keyfile */
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
result = read_sessionkey(mctx, lctx); result = read_sessionkey(mctx);
if (result == ISC_R_SUCCESS) { if (result == ISC_R_SUCCESS) {
return; return;
} }
@ -812,13 +811,13 @@ setup_system(void *arg ISC_ATTR_UNUSED) {
ddebug("setup_system()"); ddebug("setup_system()");
dns_log_init(glctx); dns_log_init();
logconfig = isc_logconfig_get(glctx); logconfig = isc_logconfig_get();
result = isc_log_usechannel(logconfig, "default_debug", NULL, NULL); result = isc_log_usechannel(logconfig, "default_debug", NULL, NULL);
check_result(result, "isc_log_usechannel"); check_result(result, "isc_log_usechannel");
isc_log_setdebuglevel(glctx, logdebuglevel); isc_log_setdebuglevel(logdebuglevel);
result = irs_resconf_load(gmctx, resolvconf, &resconf); result = irs_resconf_load(gmctx, resolvconf, &resconf);
if (result != ISC_R_SUCCESS && result != ISC_R_FILENOTFOUND) { if (result != ISC_R_SUCCESS && result != ISC_R_FILENOTFOUND) {
@ -971,13 +970,13 @@ setup_system(void *arg ISC_ATTR_UNUSED) {
if (keystr != NULL) { if (keystr != NULL) {
setup_keystr(); setup_keystr();
} else if (local_only) { } else if (local_only) {
result = read_sessionkey(gmctx, glctx); result = read_sessionkey(gmctx);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
fatal("can't read key from %s: %s\n", keyfile, fatal("can't read key from %s: %s\n", keyfile,
isc_result_totext(result)); isc_result_totext(result));
} }
} else if (keyfile != NULL) { } else if (keyfile != NULL) {
setup_keyfile(gmctx, glctx); setup_keyfile(gmctx);
} }
isc_mutex_init(&answer_lock); isc_mutex_init(&answer_lock);

View File

@ -231,8 +231,7 @@ parse_filter_a_on(const cfg_obj_t *param_obj, const char *param_name,
} }
static isc_result_t static isc_result_t
check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, isc_log_t *lctx, check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, void *actx) {
void *actx) {
isc_result_t result = ISC_R_SUCCESS; isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *aclobj = NULL; const cfg_obj_t *aclobj = NULL;
dns_acl_t *acl = NULL; dns_acl_t *acl = NULL;
@ -243,20 +242,20 @@ check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, isc_log_t *lctx,
return (result); return (result);
} }
CHECK(cfg_acl_fromconfig(aclobj, (const cfg_obj_t *)cfg, lctx, CHECK(cfg_acl_fromconfig(aclobj, (const cfg_obj_t *)cfg,
(cfg_aclconfctx_t *)actx, mctx, 0, &acl)); (cfg_aclconfctx_t *)actx, mctx, 0, &acl));
CHECK(parse_filter_a_on(fmap, "filter-a-on-v6", &f6)); CHECK(parse_filter_a_on(fmap, "filter-a-on-v6", &f6));
CHECK(parse_filter_a_on(fmap, "filter-a-on-v4", &f4)); CHECK(parse_filter_a_on(fmap, "filter-a-on-v4", &f4));
if ((f4 != NONE || f6 != NONE) && dns_acl_isnone(acl)) { if ((f4 != NONE || f6 != NONE) && dns_acl_isnone(acl)) {
cfg_obj_log(aclobj, lctx, ISC_LOG_WARNING, cfg_obj_log(aclobj, ISC_LOG_WARNING,
"\"filter-a\" is 'none;' but " "\"filter-a\" is 'none;' but "
"either filter-a-on-v6 or filter-a-on-v4 " "either filter-a-on-v6 or filter-a-on-v4 "
"is enabled"); "is enabled");
result = ISC_R_FAILURE; result = ISC_R_FAILURE;
} else if (f4 == NONE && f6 == NONE && !dns_acl_isnone(acl)) { } else if (f4 == NONE && f6 == NONE && !dns_acl_isnone(acl)) {
cfg_obj_log(aclobj, lctx, ISC_LOG_WARNING, cfg_obj_log(aclobj, ISC_LOG_WARNING,
"\"filter-a\" is set but " "\"filter-a\" is set but "
"neither filter-a-on-v6 or filter-a-on-v4 " "neither filter-a-on-v6 or filter-a-on-v4 "
"is enabled"); "is enabled");
@ -274,28 +273,28 @@ cleanup:
static isc_result_t static isc_result_t
parse_parameters(filter_instance_t *inst, const char *parameters, parse_parameters(filter_instance_t *inst, const char *parameters,
const void *cfg, const char *cfg_file, unsigned long cfg_line, const void *cfg, const char *cfg_file, unsigned long cfg_line,
isc_mem_t *mctx, isc_log_t *lctx, void *actx) { isc_mem_t *mctx, void *actx) {
isc_result_t result = ISC_R_SUCCESS; isc_result_t result = ISC_R_SUCCESS;
cfg_parser_t *parser = NULL; cfg_parser_t *parser = NULL;
cfg_obj_t *param_obj = NULL; cfg_obj_t *param_obj = NULL;
const cfg_obj_t *obj = NULL; const cfg_obj_t *obj = NULL;
isc_buffer_t b; isc_buffer_t b;
CHECK(cfg_parser_create(mctx, lctx, &parser)); CHECK(cfg_parser_create(mctx, &parser));
isc_buffer_constinit(&b, parameters, strlen(parameters)); isc_buffer_constinit(&b, parameters, strlen(parameters));
isc_buffer_add(&b, strlen(parameters)); isc_buffer_add(&b, strlen(parameters));
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line, CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj)); &cfg_type_parameters, 0, &param_obj));
CHECK(check_syntax(param_obj, cfg, mctx, lctx, actx)); CHECK(check_syntax(param_obj, cfg, mctx, actx));
CHECK(parse_filter_a_on(param_obj, "filter-a-on-v6", &inst->v6_a)); CHECK(parse_filter_a_on(param_obj, "filter-a-on-v6", &inst->v6_a));
CHECK(parse_filter_a_on(param_obj, "filter-a-on-v4", &inst->v4_a)); CHECK(parse_filter_a_on(param_obj, "filter-a-on-v4", &inst->v4_a));
result = cfg_map_get(param_obj, "filter-a", &obj); result = cfg_map_get(param_obj, "filter-a", &obj);
if (result == ISC_R_SUCCESS) { if (result == ISC_R_SUCCESS) {
CHECK(cfg_acl_fromconfig(obj, (const cfg_obj_t *)cfg, lctx, CHECK(cfg_acl_fromconfig(obj, (const cfg_obj_t *)cfg,
(cfg_aclconfctx_t *)actx, mctx, 0, (cfg_aclconfctx_t *)actx, mctx, 0,
&inst->a_acl)); &inst->a_acl));
} else { } else {
@ -327,13 +326,12 @@ cleanup:
*/ */
isc_result_t isc_result_t
plugin_register(const char *parameters, const void *cfg, const char *cfg_file, plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, isc_log_t *lctx, unsigned long cfg_line, isc_mem_t *mctx, void *actx,
void *actx, ns_hooktable_t *hooktable, void **instp) { ns_hooktable_t *hooktable, void **instp) {
filter_instance_t *inst = NULL; filter_instance_t *inst = NULL;
isc_result_t result = ISC_R_SUCCESS; isc_result_t result = ISC_R_SUCCESS;
isc_log_write(lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS, isc_log_write(NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS, ISC_LOG_INFO,
ISC_LOG_INFO,
"registering 'filter-a' " "registering 'filter-a' "
"module from %s:%lu, %s parameters", "module from %s:%lu, %s parameters",
cfg_file, cfg_line, parameters != NULL ? "with" : "no"); cfg_file, cfg_line, parameters != NULL ? "with" : "no");
@ -344,7 +342,7 @@ plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
if (parameters != NULL) { if (parameters != NULL) {
CHECK(parse_parameters(inst, parameters, cfg, cfg_file, CHECK(parse_parameters(inst, parameters, cfg, cfg_file,
cfg_line, mctx, lctx, actx)); cfg_line, mctx, actx));
} }
isc_ht_init(&inst->ht, mctx, 1, ISC_HT_CASE_SENSITIVE); isc_ht_init(&inst->ht, mctx, 1, ISC_HT_CASE_SENSITIVE);
@ -367,21 +365,20 @@ cleanup:
isc_result_t isc_result_t
plugin_check(const char *parameters, const void *cfg, const char *cfg_file, plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, isc_log_t *lctx, unsigned long cfg_line, isc_mem_t *mctx, void *actx) {
void *actx) {
isc_result_t result = ISC_R_SUCCESS; isc_result_t result = ISC_R_SUCCESS;
cfg_parser_t *parser = NULL; cfg_parser_t *parser = NULL;
cfg_obj_t *param_obj = NULL; cfg_obj_t *param_obj = NULL;
isc_buffer_t b; isc_buffer_t b;
CHECK(cfg_parser_create(mctx, lctx, &parser)); CHECK(cfg_parser_create(mctx, &parser));
isc_buffer_constinit(&b, parameters, strlen(parameters)); isc_buffer_constinit(&b, parameters, strlen(parameters));
isc_buffer_add(&b, strlen(parameters)); isc_buffer_add(&b, strlen(parameters));
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line, CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj)); &cfg_type_parameters, 0, &param_obj));
CHECK(check_syntax(param_obj, cfg, mctx, lctx, actx)); CHECK(check_syntax(param_obj, cfg, mctx, actx));
cleanup: cleanup:
if (param_obj != NULL) { if (param_obj != NULL) {

View File

@ -232,8 +232,7 @@ parse_filter_aaaa_on(const cfg_obj_t *param_obj, const char *param_name,
} }
static isc_result_t static isc_result_t
check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, isc_log_t *lctx, check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, void *actx) {
void *actx) {
isc_result_t result = ISC_R_SUCCESS; isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *aclobj = NULL; const cfg_obj_t *aclobj = NULL;
dns_acl_t *acl = NULL; dns_acl_t *acl = NULL;
@ -244,20 +243,20 @@ check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, isc_log_t *lctx,
return (result); return (result);
} }
CHECK(cfg_acl_fromconfig(aclobj, (const cfg_obj_t *)cfg, lctx, CHECK(cfg_acl_fromconfig(aclobj, (const cfg_obj_t *)cfg,
(cfg_aclconfctx_t *)actx, mctx, 0, &acl)); (cfg_aclconfctx_t *)actx, mctx, 0, &acl));
CHECK(parse_filter_aaaa_on(fmap, "filter-aaaa-on-v4", &f4)); CHECK(parse_filter_aaaa_on(fmap, "filter-aaaa-on-v4", &f4));
CHECK(parse_filter_aaaa_on(fmap, "filter-aaaa-on-v6", &f6)); CHECK(parse_filter_aaaa_on(fmap, "filter-aaaa-on-v6", &f6));
if ((f4 != NONE || f6 != NONE) && dns_acl_isnone(acl)) { if ((f4 != NONE || f6 != NONE) && dns_acl_isnone(acl)) {
cfg_obj_log(aclobj, lctx, ISC_LOG_WARNING, cfg_obj_log(aclobj, ISC_LOG_WARNING,
"\"filter-aaaa\" is 'none;' but " "\"filter-aaaa\" is 'none;' but "
"either filter-aaaa-on-v4 or filter-aaaa-on-v6 " "either filter-aaaa-on-v4 or filter-aaaa-on-v6 "
"is enabled"); "is enabled");
result = ISC_R_FAILURE; result = ISC_R_FAILURE;
} else if (f4 == NONE && f6 == NONE && !dns_acl_isnone(acl)) { } else if (f4 == NONE && f6 == NONE && !dns_acl_isnone(acl)) {
cfg_obj_log(aclobj, lctx, ISC_LOG_WARNING, cfg_obj_log(aclobj, ISC_LOG_WARNING,
"\"filter-aaaa\" is set but " "\"filter-aaaa\" is set but "
"neither filter-aaaa-on-v4 or filter-aaaa-on-v6 " "neither filter-aaaa-on-v4 or filter-aaaa-on-v6 "
"is enabled"); "is enabled");
@ -275,21 +274,21 @@ cleanup:
static isc_result_t static isc_result_t
parse_parameters(filter_instance_t *inst, const char *parameters, parse_parameters(filter_instance_t *inst, const char *parameters,
const void *cfg, const char *cfg_file, unsigned long cfg_line, const void *cfg, const char *cfg_file, unsigned long cfg_line,
isc_mem_t *mctx, isc_log_t *lctx, void *actx) { isc_mem_t *mctx, void *actx) {
isc_result_t result = ISC_R_SUCCESS; isc_result_t result = ISC_R_SUCCESS;
cfg_parser_t *parser = NULL; cfg_parser_t *parser = NULL;
cfg_obj_t *param_obj = NULL; cfg_obj_t *param_obj = NULL;
const cfg_obj_t *obj = NULL; const cfg_obj_t *obj = NULL;
isc_buffer_t b; isc_buffer_t b;
CHECK(cfg_parser_create(mctx, lctx, &parser)); CHECK(cfg_parser_create(mctx, &parser));
isc_buffer_constinit(&b, parameters, strlen(parameters)); isc_buffer_constinit(&b, parameters, strlen(parameters));
isc_buffer_add(&b, strlen(parameters)); isc_buffer_add(&b, strlen(parameters));
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line, CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj)); &cfg_type_parameters, 0, &param_obj));
CHECK(check_syntax(param_obj, cfg, mctx, lctx, actx)); CHECK(check_syntax(param_obj, cfg, mctx, actx));
CHECK(parse_filter_aaaa_on(param_obj, "filter-aaaa-on-v4", CHECK(parse_filter_aaaa_on(param_obj, "filter-aaaa-on-v4",
&inst->v4_aaaa)); &inst->v4_aaaa));
@ -298,7 +297,7 @@ parse_parameters(filter_instance_t *inst, const char *parameters,
result = cfg_map_get(param_obj, "filter-aaaa", &obj); result = cfg_map_get(param_obj, "filter-aaaa", &obj);
if (result == ISC_R_SUCCESS) { if (result == ISC_R_SUCCESS) {
CHECK(cfg_acl_fromconfig(obj, (const cfg_obj_t *)cfg, lctx, CHECK(cfg_acl_fromconfig(obj, (const cfg_obj_t *)cfg,
(cfg_aclconfctx_t *)actx, mctx, 0, (cfg_aclconfctx_t *)actx, mctx, 0,
&inst->aaaa_acl)); &inst->aaaa_acl));
} else { } else {
@ -330,13 +329,12 @@ cleanup:
*/ */
isc_result_t isc_result_t
plugin_register(const char *parameters, const void *cfg, const char *cfg_file, plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, isc_log_t *lctx, unsigned long cfg_line, isc_mem_t *mctx, void *actx,
void *actx, ns_hooktable_t *hooktable, void **instp) { ns_hooktable_t *hooktable, void **instp) {
filter_instance_t *inst = NULL; filter_instance_t *inst = NULL;
isc_result_t result = ISC_R_SUCCESS; isc_result_t result = ISC_R_SUCCESS;
isc_log_write(lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS, isc_log_write(NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS, ISC_LOG_INFO,
ISC_LOG_INFO,
"registering 'filter-aaaa' " "registering 'filter-aaaa' "
"module from %s:%lu, %s parameters", "module from %s:%lu, %s parameters",
cfg_file, cfg_line, parameters != NULL ? "with" : "no"); cfg_file, cfg_line, parameters != NULL ? "with" : "no");
@ -348,7 +346,7 @@ plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
if (parameters != NULL) { if (parameters != NULL) {
CHECK(parse_parameters(inst, parameters, cfg, cfg_file, CHECK(parse_parameters(inst, parameters, cfg, cfg_file,
cfg_line, mctx, lctx, actx)); cfg_line, mctx, actx));
} }
isc_ht_init(&inst->ht, mctx, 1, ISC_HT_CASE_SENSITIVE); isc_ht_init(&inst->ht, mctx, 1, ISC_HT_CASE_SENSITIVE);
@ -371,21 +369,20 @@ cleanup:
isc_result_t isc_result_t
plugin_check(const char *parameters, const void *cfg, const char *cfg_file, plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, isc_log_t *lctx, unsigned long cfg_line, isc_mem_t *mctx, void *actx) {
void *actx) {
isc_result_t result = ISC_R_SUCCESS; isc_result_t result = ISC_R_SUCCESS;
cfg_parser_t *parser = NULL; cfg_parser_t *parser = NULL;
cfg_obj_t *param_obj = NULL; cfg_obj_t *param_obj = NULL;
isc_buffer_t b; isc_buffer_t b;
CHECK(cfg_parser_create(mctx, lctx, &parser)); CHECK(cfg_parser_create(mctx, &parser));
isc_buffer_constinit(&b, parameters, strlen(parameters)); isc_buffer_constinit(&b, parameters, strlen(parameters));
isc_buffer_add(&b, strlen(parameters)); isc_buffer_add(&b, strlen(parameters));
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line, CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj)); &cfg_type_parameters, 0, &param_obj));
CHECK(check_syntax(param_obj, cfg, mctx, lctx, actx)); CHECK(check_syntax(param_obj, cfg, mctx, actx));
cleanup: cleanup:
if (param_obj != NULL) { if (param_obj != NULL) {

View File

@ -526,8 +526,8 @@ rndc_start(void *arg) {
} }
static void static void
parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname, parse_config(isc_mem_t *mctx, const char *keyname, cfg_parser_t **pctxp,
cfg_parser_t **pctxp, cfg_obj_t **configp) { cfg_obj_t **configp) {
isc_result_t result; isc_result_t result;
const char *conffile = admin_conffile; const char *conffile = admin_conffile;
const cfg_obj_t *addresses = NULL; const cfg_obj_t *addresses = NULL;
@ -570,7 +570,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
admin_keyfile, admin_conffile); admin_keyfile, admin_conffile);
} }
DO("create parser", cfg_parser_create(mctx, log, pctxp)); DO("create parser", cfg_parser_create(mctx, pctxp));
/* /*
* The parser will output its own errors, so DO() is not used. * The parser will output its own errors, so DO() is not used.
@ -806,7 +806,6 @@ int
main(int argc, char **argv) { main(int argc, char **argv) {
isc_result_t result = ISC_R_SUCCESS; isc_result_t result = ISC_R_SUCCESS;
bool show_final_mem = false; bool show_final_mem = false;
isc_log_t *log = NULL;
isc_logconfig_t *logconfig = NULL; isc_logconfig_t *logconfig = NULL;
isc_logdestination_t logdest; isc_logdestination_t logdest;
cfg_parser_t *pctx = NULL; cfg_parser_t *pctx = NULL;
@ -954,7 +953,7 @@ main(int argc, char **argv) {
isc_nm_settimeouts(netmgr, timeout, timeout, timeout, 0); isc_nm_settimeouts(netmgr, timeout, timeout, timeout, 0);
logconfig = isc_logconfig_get(log); logconfig = isc_logconfig_get();
isc_log_settag(logconfig, progname); isc_log_settag(logconfig, progname);
logdest.file.stream = stderr; logdest.file.stream = stderr;
logdest.file.name = NULL; logdest.file.name = NULL;
@ -966,7 +965,7 @@ main(int argc, char **argv) {
DO("enabling log channel", DO("enabling log channel",
isc_log_usechannel(logconfig, "stderr", NULL, NULL)); isc_log_usechannel(logconfig, "stderr", NULL, NULL));
parse_config(rndc_mctx, log, keyname, &pctx, &config); parse_config(rndc_mctx, keyname, &pctx, &config);
isc_buffer_allocate(rndc_mctx, &databuf, 2048); isc_buffer_allocate(rndc_mctx, &databuf, 2048);

View File

@ -38,7 +38,7 @@ log_write(int level, const char *format, ...) {
va_list args; va_list args;
va_start(args, format); va_start(args, format);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB, isc_log_vwrite(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB, level,
level, format, args); format, args);
va_end(args); va_end(args);
} }

View File

@ -54,7 +54,6 @@ typedef struct async_instance {
isc_mem_t *mctx; isc_mem_t *mctx;
isc_ht_t *ht; isc_ht_t *ht;
isc_mutex_t hlock; isc_mutex_t hlock;
isc_log_t *lctx;
} async_instance_t; } async_instance_t;
typedef struct state { typedef struct state {
@ -106,8 +105,8 @@ logmsg(const char *fmt, ...) {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS, isc_log_write(NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS, ISC_LOG_INFO,
ISC_LOG_INFO, fmt, ap); fmt, ap);
va_end(ap); va_end(ap);
} }
@ -126,16 +125,15 @@ logmsg(const char *fmt, ...) {
*/ */
isc_result_t isc_result_t
plugin_register(const char *parameters, const void *cfg, const char *cfg_file, plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, isc_log_t *lctx, unsigned long cfg_line, isc_mem_t *mctx, void *actx,
void *actx, ns_hooktable_t *hooktable, void **instp) { ns_hooktable_t *hooktable, void **instp) {
async_instance_t *inst = NULL; async_instance_t *inst = NULL;
UNUSED(parameters); UNUSED(parameters);
UNUSED(cfg); UNUSED(cfg);
UNUSED(actx); UNUSED(actx);
isc_log_write(lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS, isc_log_write(NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS, ISC_LOG_INFO,
ISC_LOG_INFO,
"registering 'test-async' module from %s:%lu", cfg_file, "registering 'test-async' module from %s:%lu", cfg_file,
cfg_line); cfg_line);
@ -158,14 +156,12 @@ plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
isc_result_t isc_result_t
plugin_check(const char *parameters, const void *cfg, const char *cfg_file, plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, isc_log_t *lctx, unsigned long cfg_line, isc_mem_t *mctx, void *actx) {
void *actx) {
UNUSED(parameters); UNUSED(parameters);
UNUSED(cfg); UNUSED(cfg);
UNUSED(cfg_file); UNUSED(cfg_file);
UNUSED(cfg_line); UNUSED(cfg_line);
UNUSED(mctx); UNUSED(mctx);
UNUSED(lctx);
UNUSED(actx); UNUSED(actx);
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);

View File

@ -30,7 +30,6 @@
#include <dns/types.h> #include <dns/types.h>
isc_mem_t *mctx = NULL; isc_mem_t *mctx = NULL;
isc_log_t *lctx = NULL;
/* /*
* Logging categories: this needs to match the list in bin/named/log.c. * Logging categories: this needs to match the list in bin/named/log.c.
@ -92,10 +91,10 @@ main(int argc, char **argv) {
isc_mem_debugging |= ISC_MEM_DEBUGRECORD; isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
isc_mem_create(&mctx); isc_mem_create(&mctx);
isc_log_registercategories(lctx, categories); isc_log_registercategories(categories);
dns_log_init(lctx); dns_log_init();
logconfig = isc_logconfig_get(lctx); logconfig = isc_logconfig_get();
destination.file.stream = stderr; destination.file.stream = stderr;
destination.file.name = NULL; destination.file.name = NULL;
destination.file.versions = ISC_LOG_ROLLNEVER; destination.file.versions = ISC_LOG_ROLLNEVER;

View File

@ -46,7 +46,6 @@ dns_fixedname_t fname;
dns_name_t *name; dns_name_t *name;
unsigned int bits = 2048U; unsigned int bits = 2048U;
isc_mem_t *mctx; isc_mem_t *mctx;
isc_log_t *log_;
isc_logconfig_t *logconfig; isc_logconfig_t *logconfig;
int level = ISC_LOG_WARNING; int level = ISC_LOG_WARNING;
isc_logdestination_t destination; isc_logdestination_t destination;
@ -106,9 +105,9 @@ main(int argc, char **argv) {
isc_mem_create(&mctx); isc_mem_create(&mctx);
dns_log_init(log_); dns_log_init();
logconfig = isc_logconfig_get(log_); logconfig = isc_logconfig_get();
isc_log_settag(logconfig, "bigkey"); isc_log_settag(logconfig, "bigkey");
destination.file.stream = stderr; destination.file.stream = stderr;

View File

@ -36,15 +36,14 @@ usage(void) {
/* /*
* Setup logging to use stderr. * Setup logging to use stderr.
*/ */
static isc_result_t static void
setup_logging(isc_mem_t *mctx ISC_ATTR_UNUSED, FILE *errout, isc_log_t **logp) { setup_logging(FILE *errout) {
isc_logdestination_t destination; isc_logdestination_t destination;
isc_logconfig_t *logconfig = NULL; isc_logconfig_t *logconfig = NULL;
isc_log_t *log = NULL;
dns_log_init(log); dns_log_init();
logconfig = isc_logconfig_get(log); logconfig = isc_logconfig_get();
destination.file.stream = errout; destination.file.stream = errout;
destination.file.name = NULL; destination.file.name = NULL;
destination.file.versions = ISC_LOG_ROLLNEVER; destination.file.versions = ISC_LOG_ROLLNEVER;
@ -54,9 +53,6 @@ setup_logging(isc_mem_t *mctx ISC_ATTR_UNUSED, FILE *errout, isc_log_t **logp) {
RUNTIME_CHECK(isc_log_usechannel(logconfig, "stderr", NULL, NULL) == RUNTIME_CHECK(isc_log_usechannel(logconfig, "stderr", NULL, NULL) ==
ISC_R_SUCCESS); ISC_R_SUCCESS);
*logp = log;
return (ISC_R_SUCCESS);
} }
int int
@ -64,7 +60,6 @@ main(int argc, char **argv) {
char *file; char *file;
isc_mem_t *mctx = NULL; isc_mem_t *mctx = NULL;
isc_result_t result; isc_result_t result;
isc_log_t *lctx = NULL;
uint32_t flags = 0U; uint32_t flags = 0U;
int ch; int ch;
bool compact = false; bool compact = false;
@ -108,7 +103,7 @@ main(int argc, char **argv) {
file = argv[0]; file = argv[0];
isc_mem_create(&mctx); isc_mem_create(&mctx);
RUNTIME_CHECK(setup_logging(mctx, stderr, &lctx) == ISC_R_SUCCESS); setup_logging(stderr);
if (upgrade) { if (upgrade) {
flags = DNS_JOURNAL_COMPACTALL; flags = DNS_JOURNAL_COMPACTALL;

View File

@ -1047,20 +1047,15 @@ for the category at all.
##### Externally visible structure ##### Externally visible structure
The types used by programs for configuring log message destinations are The type used by programs for configuring log message destinations is
`isc_log_t` and `isc_logconfig_t`. The `isc_log_t` type is normally `isc_logconfig_t`. It is used to store the configurable specification of
created only once by a program, to hold static information about what message destinations, which can be changed during the course of the program.
categories and modules exist in the program and some other housekeeping
information. `isc_logconfig_t` is used to store the configurable
specification of message destinations, which can be changed during the
course of the program.
A starting configuration (`isc_logconfig_t`) is created implicitly when A starting configuration (`isc_logconfig_t`) is created implicitly. The pointer
the context (`isc_log_t`) is created. The pointer to this configuration to this configuration is returned via `isc_logconfig_get()` so that it can then
is returned via a parameter to `isc_log_create()` so that it can then be be configured. A new log configuration can be established by creating it with
configured. A new log configuration can be established by creating `isc_logconfig_create()`, configuring it, then installing it as the active
it with `isc_logconfig_create()`, configuring it, then installing it as configuration with `isc_logconfig_set()`.
the active configuration with `isc_logconfig_set()`.
##### Logging in multithreaded programs ##### Logging in multithreaded programs
@ -1088,18 +1083,16 @@ the following steps need to be taken to initialize it.
rudimentary initialization of both. rudimentary initialization of both.
isc_mem_t *mctx; isc_mem_t *mctx;
isc_log_t *lctx;
isc_logconfig_t *lcfg; isc_logconfig_t *lcfg;
isc_mem_create(&mctx); lcfg = isc_logconfig_get();
isc_log_create(mctx, &lctx, &lcfg) != ISC_R_SUCCESS);
1. Initialize any additional libraries. The convention for the name of 1. Initialize any additional libraries. The convention for the name of
the initialization function is `{library}_log_init()`, with a pointer to the initialization function is `{library}_log_init()`, with a pointer to
the logging context as an argument. The function can only be called the logging context as an argument. The function can only be called
once in a program or it will generate an assertion. once in a program or it will generate an assertion.
`dns_log_init(lctx);` `dns_log_init();`
If you do not want a library to write any log messages, simply do not If you do not want a library to write any log messages, simply do not
call its the initialization function. call its the initialization function.
@ -1164,14 +1157,14 @@ There are three additional functions you might find useful in your program
to control logging behavior, two to work with the debugging level and one to control logging behavior, two to work with the debugging level and one
to control the closing of log files. to control the closing of log files.
void isc_log_setdebuglevel(isc_log_t *lctx, unsigned int level); void isc_log_setdebuglevel(unsigned int level);
unsigned int isc_log_getdebuglevel(isc_log_t *lctx); unsigned int isc_log_getdebuglevel();
These set and retrieve the current debugging level of the program. These set and retrieve the current debugging level of the program.
`isc_log_getdebuglevel()` can be used so that you need not keep track of `isc_log_getdebuglevel()` can be used so that you need not keep track of
the level yourself in another variable. the level yourself in another variable.
void isc_log_closefilelogs(isc_log_t *lcxt); void isc_log_closefilelogs();
This function closes any open log files. This is useful for programs that This function closes any open log files. This is useful for programs that
do not want to do file rotation as with the internal rolling mechanism. do not want to do file rotation as with the internal rolling mechanism.

View File

@ -59,7 +59,6 @@ int
main(int argc, char **argv) { main(int argc, char **argv) {
isc_result_t result; isc_result_t result;
isc_mem_t *mctx = NULL; isc_mem_t *mctx = NULL;
isc_log_t *lctx = NULL;
isc_logconfig_t *lcfg = NULL; isc_logconfig_t *lcfg = NULL;
isc_logdestination_t destination; isc_logdestination_t destination;
cfg_parser_t *pctx = NULL; cfg_parser_t *pctx = NULL;
@ -76,7 +75,7 @@ main(int argc, char **argv) {
/* /*
* Create and install the default channel. * Create and install the default channel.
*/ */
lcfg = isc_logconfig_get(lctx); lcfg = isc_logconfig_get();
destination.file.stream = stderr; destination.file.stream = stderr;
destination.file.name = NULL; destination.file.name = NULL;
destination.file.versions = ISC_LOG_ROLLNEVER; destination.file.versions = ISC_LOG_ROLLNEVER;
@ -90,7 +89,7 @@ main(int argc, char **argv) {
/* /*
* Set the initial debug level. * Set the initial debug level.
*/ */
isc_log_setdebuglevel(lctx, 2); isc_log_setdebuglevel(2);
if (argc < 3) { if (argc < 3) {
usage(); usage();
@ -156,8 +155,7 @@ main(int argc, char **argv) {
if (type == NULL || filename == NULL) { if (type == NULL || filename == NULL) {
usage(); usage();
} }
RUNTIME_CHECK(cfg_parser_create(mctx, lctx, &pctx) == RUNTIME_CHECK(cfg_parser_create(mctx, &pctx) == ISC_R_SUCCESS);
ISC_R_SUCCESS);
result = cfg_parse_file(pctx, filename, type, &cfg); result = cfg_parse_file(pctx, filename, type, &cfg);

View File

@ -480,8 +480,8 @@ DP(int level, const char *format, ...) {
va_list args; va_list args;
va_start(args, format); va_start(args, format);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ADB, isc_log_vwrite(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ADB, level,
level, format, args); format, args);
va_end(args); va_end(args);
} }
@ -1463,8 +1463,7 @@ log_quota(dns_adbentry_t *entry, const char *fmt, ...) {
isc_netaddr_fromsockaddr(&netaddr, &entry->sockaddr); isc_netaddr_fromsockaddr(&netaddr, &entry->sockaddr);
isc_netaddr_format(&netaddr, addrbuf, sizeof(addrbuf)); isc_netaddr_format(&netaddr, addrbuf, sizeof(addrbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ADB, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ADB, ISC_LOG_INFO,
ISC_LOG_INFO,
"adb: quota %s (%" PRIuFAST32 "/%" PRIuFAST32 "): %s", "adb: quota %s (%" PRIuFAST32 "/%" PRIuFAST32 "): %s",
addrbuf, atomic_load_relaxed(&entry->active), addrbuf, atomic_load_relaxed(&entry->active),
atomic_load_relaxed(&entry->quota), msgbuf); atomic_load_relaxed(&entry->quota), msgbuf);
@ -1968,7 +1967,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_loop_t *loop, isc_job_cb cb, void *cbarg,
REQUIRE(loop != NULL); REQUIRE(loop != NULL);
} }
if (isc_log_wouldlog(dns_lctx, DEF_LEVEL)) { if (isc_log_wouldlog(DEF_LEVEL)) {
dns_name_format(name, namebuf, sizeof(namebuf)); dns_name_format(name, namebuf, sizeof(namebuf));
} }

View File

@ -54,8 +54,7 @@ isclog_error_callback(dns_rdatacallbacks_t *callbacks, const char *fmt, ...) {
UNUSED(callbacks); UNUSED(callbacks);
va_start(ap, fmt); va_start(ap, fmt);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_vwrite(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER, /* XXX */
DNS_LOGMODULE_MASTER, /* XXX */
ISC_LOG_ERROR, fmt, ap); ISC_LOG_ERROR, fmt, ap);
va_end(ap); va_end(ap);
} }
@ -68,8 +67,7 @@ isclog_warn_callback(dns_rdatacallbacks_t *callbacks, const char *fmt, ...) {
va_start(ap, fmt); va_start(ap, fmt);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_vwrite(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER, /* XXX */
DNS_LOGMODULE_MASTER, /* XXX */
ISC_LOG_WARNING, fmt, ap); ISC_LOG_WARNING, fmt, ap);
va_end(ap); va_end(ap);
} }

View File

@ -565,8 +565,8 @@ dns__catz_zones_merge(dns_catz_zone_t *catz, dns_catz_zone_t *newcatz) {
dns_name_format(&nentry->name, zname, DNS_NAME_FORMATSIZE); dns_name_format(&nentry->name, zname, DNS_NAME_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3),
"catz: iterating over '%s' from catalog '%s'", "catz: iterating over '%s' from catalog '%s'",
zname, czname); zname, czname);
dns_catz_options_setdefault(catz->catzs->mctx, dns_catz_options_setdefault(catz->catzs->mctx,
@ -598,7 +598,7 @@ dns__catz_zones_merge(dns_catz_zone_t *catz, dns_catz_zone_t *newcatz) {
{ {
dns_name_format(&parentcatz->name, pczname, dns_name_format(&parentcatz->name, pczname,
DNS_NAME_FORMATSIZE); DNS_NAME_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, DNS_LOGMODULE_MASTER,
ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3),
"catz: zone '%s' " "catz: zone '%s' "
@ -608,7 +608,7 @@ dns__catz_zones_merge(dns_catz_zone_t *catz, dns_catz_zone_t *newcatz) {
result = delzone(nentry, parentcatz, result = delzone(nentry, parentcatz,
parentcatz->catzs->view, parentcatz->catzs->view,
parentcatz->catzs->zmm->udata); parentcatz->catzs->zmm->udata);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, DNS_LOGMODULE_MASTER,
ISC_LOG_INFO, ISC_LOG_INFO,
"catz: deleting zone '%s' " "catz: deleting zone '%s' "
@ -641,7 +641,7 @@ dns__catz_zones_merge(dns_catz_zone_t *catz, dns_catz_zone_t *newcatz) {
* perform deletions earlier than additions and * perform deletions earlier than additions and
* modifications. * modifications.
*/ */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, DNS_LOGMODULE_MASTER,
ISC_LOG_INFO, ISC_LOG_INFO,
"catz: zone '%s' unique label " "catz: zone '%s' unique label "
@ -655,7 +655,7 @@ dns__catz_zones_merge(dns_catz_zone_t *catz, dns_catz_zone_t *newcatz) {
} }
if (find_result != ISC_R_SUCCESS) { if (find_result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_DEBUG(3), DNS_LOGMODULE_MASTER, ISC_LOG_DEBUG(3),
"catz: zone '%s' was expected to exist " "catz: zone '%s' was expected to exist "
"but can not be found, will be restored", "but can not be found, will be restored",
@ -695,8 +695,8 @@ dns__catz_zones_merge(dns_catz_zone_t *catz, dns_catz_zone_t *newcatz) {
dns_name_format(&entry->name, zname, DNS_NAME_FORMATSIZE); dns_name_format(&entry->name, zname, DNS_NAME_FORMATSIZE);
result = delzone(entry, catz, catz->catzs->view, result = delzone(entry, catz, catz->catzs->view,
catz->catzs->zmm->udata); catz->catzs->zmm->udata);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_INFO, ISC_LOG_INFO,
"catz: deleting zone '%s' from catalog '%s' - %s", "catz: deleting zone '%s' from catalog '%s' - %s",
zname, czname, isc_result_totext(result)); zname, czname, isc_result_totext(result));
dns_catz_entry_detach(catz, &entry); dns_catz_entry_detach(catz, &entry);
@ -716,8 +716,8 @@ dns__catz_zones_merge(dns_catz_zone_t *catz, dns_catz_zone_t *newcatz) {
dns_name_format(&entry->name, zname, DNS_NAME_FORMATSIZE); dns_name_format(&entry->name, zname, DNS_NAME_FORMATSIZE);
result = addzone(entry, catz, catz->catzs->view, result = addzone(entry, catz, catz->catzs->view,
catz->catzs->zmm->udata); catz->catzs->zmm->udata);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_INFO, ISC_LOG_INFO,
"catz: adding zone '%s' from catalog " "catz: adding zone '%s' from catalog "
"'%s' - %s", "'%s' - %s",
zname, czname, isc_result_totext(result)); zname, czname, isc_result_totext(result));
@ -732,8 +732,8 @@ dns__catz_zones_merge(dns_catz_zone_t *catz, dns_catz_zone_t *newcatz) {
dns_name_format(&entry->name, zname, DNS_NAME_FORMATSIZE); dns_name_format(&entry->name, zname, DNS_NAME_FORMATSIZE);
result = modzone(entry, catz, catz->catzs->view, result = modzone(entry, catz, catz->catzs->view,
catz->catzs->zmm->udata); catz->catzs->zmm->udata);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_INFO, ISC_LOG_INFO,
"catz: modifying zone '%s' from catalog " "catz: modifying zone '%s' from catalog "
"'%s' - %s", "'%s' - %s",
zname, czname, isc_result_totext(result)); zname, czname, isc_result_totext(result));
@ -855,8 +855,8 @@ dns__catz_timer_start(dns_catz_zone_t *catz) {
char dname[DNS_NAME_FORMATSIZE]; char dname[DNS_NAME_FORMATSIZE];
dns_name_format(&catz->name, dname, DNS_NAME_FORMATSIZE); dns_name_format(&catz->name, dname, DNS_NAME_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_INFO, ISC_LOG_INFO,
"catz: %s: new zone version came " "catz: %s: new zone version came "
"too soon, deferring update for " "too soon, deferring update for "
"%" PRIu64 " seconds", "%" PRIu64 " seconds",
@ -897,7 +897,7 @@ dns_catz_zone_add(dns_catz_zones_t *catzs, const dns_name_t *name,
char zname[DNS_NAME_FORMATSIZE]; char zname[DNS_NAME_FORMATSIZE];
dns_name_format(name, zname, DNS_NAME_FORMATSIZE); dns_name_format(name, zname, DNS_NAME_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
ISC_LOG_DEBUG(3), "catz: dns_catz_zone_add %s", zname); ISC_LOG_DEBUG(3), "catz: dns_catz_zone_add %s", zname);
LOCK(&catzs->lock); LOCK(&catzs->lock);
@ -1187,8 +1187,8 @@ catz_process_coo(dns_catz_zone_t *catz, dns_label_t *mhash,
} }
if (dns_rdataset_count(value) != 1) { if (dns_rdataset_count(value) != 1) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_WARNING, ISC_LOG_WARNING,
"catz: 'coo' property PTR RRset contains " "catz: 'coo' property PTR RRset contains "
"more than one record, which is invalid"); "more than one record, which is invalid");
catz->broken = true; catz->broken = true;
@ -1246,8 +1246,8 @@ catz_process_zones_entry(dns_catz_zone_t *catz, dns_rdataset_t *value,
} }
if (dns_rdataset_count(value) != 1) { if (dns_rdataset_count(value) != 1) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_WARNING, ISC_LOG_WARNING,
"catz: member zone PTR RRset contains " "catz: member zone PTR RRset contains "
"more than one record, which is invalid"); "more than one record, which is invalid");
catz->broken = true; catz->broken = true;
@ -1307,8 +1307,8 @@ catz_process_version(dns_catz_zone_t *catz, dns_rdataset_t *value) {
} }
if (dns_rdataset_count(value) != 1) { if (dns_rdataset_count(value) != 1) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_WARNING, ISC_LOG_WARNING,
"catz: 'version' property TXT RRset contains " "catz: 'version' property TXT RRset contains "
"more than one record, which is invalid"); "more than one record, which is invalid");
catz->broken = true; catz->broken = true;
@ -1359,8 +1359,8 @@ catz_process_version(dns_catz_zone_t *catz, dns_rdataset_t *value) {
cleanup: cleanup:
dns_rdata_freestruct(&rdatatxt); dns_rdata_freestruct(&rdatatxt);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_WARNING, ISC_LOG_WARNING,
"catz: invalid record for the catalog " "catz: invalid record for the catalog "
"zone version property"); "zone version property");
catz->broken = true; catz->broken = true;
@ -1572,8 +1572,8 @@ catz_process_apl(dns_catz_zone_t *catz, isc_buffer_t **aclbp,
} }
if (dns_rdataset_count(value) > 1) { if (dns_rdataset_count(value) > 1) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_WARNING, ISC_LOG_WARNING,
"catz: more than one APL entry for member zone, " "catz: more than one APL entry for member zone, "
"result is undefined"); "result is undefined");
} }
@ -1713,8 +1713,8 @@ catz_entry_add_or_mod(dns_catz_zone_t *catz, isc_ht_t *ht, unsigned char *key,
isc_result_t result = isc_ht_add(ht, key, (uint32_t)keysize, nentry); isc_result_t result = isc_ht_add(ht, key, (uint32_t)keysize, nentry);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, ISC_LOG_ERROR,
"catz: error %s zone '%s' from catalog '%s' - %s", "catz: error %s zone '%s' from catalog '%s' - %s",
msg, zname, czname, isc_result_totext(result)); msg, zname, czname, isc_result_totext(result));
} }
@ -1811,8 +1811,8 @@ dns__catz_update_process(dns_catz_zone_t *catz, const dns_name_t *src_name,
REQUIRE(ISC_MAGIC_VALID(src_name, DNS_NAME_MAGIC)); REQUIRE(ISC_MAGIC_VALID(src_name, DNS_NAME_MAGIC));
if (rdataset->rdclass != dns_rdataclass_in) { if (rdataset->rdclass != dns_rdataclass_in) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, ISC_LOG_ERROR,
"catz: RR found which has a non-IN class"); "catz: RR found which has a non-IN class");
catz->broken = true; catz->broken = true;
return (ISC_R_FAILURE); return (ISC_R_FAILURE);
@ -1998,7 +1998,7 @@ dns_catz_generate_zonecfg(dns_catz_zone_t *catz, dns_catz_entry_t *entry,
default: default:
dns_name_format(&entry->name, zname, dns_name_format(&entry->name, zname,
DNS_NAME_FORMATSIZE); DNS_NAME_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, DNS_LOGMODULE_MASTER, ISC_LOG_ERROR,
"catz: zone '%s' uses an invalid primary " "catz: zone '%s' uses an invalid primary "
"(no IP address assigned)", "(no IP address assigned)",
@ -2093,8 +2093,8 @@ dns__catz_timer_cb(void *arg) {
dns_name_format(&catz->name, domain, DNS_NAME_FORMATSIZE); dns_name_format(&catz->name, domain, DNS_NAME_FORMATSIZE);
if (!catz->active) { if (!catz->active) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_INFO, ISC_LOG_INFO,
"catz: %s: no longer active, reload is canceled", "catz: %s: no longer active, reload is canceled",
domain); domain);
catz->updaterunning = false; catz->updaterunning = false;
@ -2106,7 +2106,7 @@ dns__catz_timer_cb(void *arg) {
catz->updbversion = catz->dbversion; catz->updbversion = catz->dbversion;
catz->dbversion = NULL; catz->dbversion = NULL;
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
ISC_LOG_INFO, "catz: %s: reload start", domain); ISC_LOG_INFO, "catz: %s: reload start", domain);
dns_catz_zone_ref(catz); dns_catz_zone_ref(catz);
@ -2175,8 +2175,8 @@ dns_catz_dbupdate_callback(dns_db_t *db, void *fn_arg) {
catz->updatepending = true; catz->updatepending = true;
dns_name_format(&catz->name, dname, DNS_NAME_FORMATSIZE); dns_name_format(&catz->name, dname, DNS_NAME_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3),
"catz: %s: update already queued or running", "catz: %s: update already queued or running",
dname); dname);
if (catz->dbversion != NULL) { if (catz->dbversion != NULL) {
@ -2269,16 +2269,16 @@ dns__catz_update_cb(void *data) {
UNLOCK(&catzs->lock); UNLOCK(&catzs->lock);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
/* This can happen if we remove the zone in the meantime. */ /* This can happen if we remove the zone in the meantime. */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, ISC_LOG_ERROR, "catz: zone '%s' not in config",
"catz: zone '%s' not in config", bname); bname);
goto exit; goto exit;
} }
if (!is_active) { if (!is_active) {
/* This can happen during a reconfiguration. */ /* This can happen during a reconfiguration. */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_INFO, ISC_LOG_INFO,
"catz: zone '%s' is no longer active", bname); "catz: zone '%s' is no longer active", bname);
result = ISC_R_CANCELED; result = ISC_R_CANCELED;
goto exit; goto exit;
@ -2287,22 +2287,22 @@ dns__catz_update_cb(void *data) {
result = dns_db_getsoaserial(updb, oldcatz->updbversion, &vers); result = dns_db_getsoaserial(updb, oldcatz->updbversion, &vers);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
/* A zone without SOA record?!? */ /* A zone without SOA record?!? */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, ISC_LOG_ERROR,
"catz: zone '%s' has no SOA record (%s)", bname, "catz: zone '%s' has no SOA record (%s)", bname,
isc_result_totext(result)); isc_result_totext(result));
goto exit; goto exit;
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
ISC_LOG_INFO, ISC_LOG_INFO,
"catz: updating catalog zone '%s' with serial %" PRIu32, "catz: updating catalog zone '%s' with serial %" PRIu32,
bname, vers); bname, vers);
result = dns_db_createiterator(updb, DNS_DB_NONSEC3, &updbit); result = dns_db_createiterator(updb, DNS_DB_NONSEC3, &updbit);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, ISC_LOG_ERROR,
"catz: failed to create DB iterator - %s", "catz: failed to create DB iterator - %s",
isc_result_totext(result)); isc_result_totext(result));
goto exit; goto exit;
@ -2318,8 +2318,8 @@ dns__catz_update_cb(void *data) {
result = dns_name_fromstring(name, "version", &updb->origin, 0, NULL); result = dns_name_fromstring(name, "version", &updb->origin, 0, NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
dns_dbiterator_destroy(&updbit); dns_dbiterator_destroy(&updbit);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, ISC_LOG_ERROR,
"catz: failed to create name from string - %s", "catz: failed to create name from string - %s",
isc_result_totext(result)); isc_result_totext(result));
goto exit; goto exit;
@ -2328,8 +2328,8 @@ dns__catz_update_cb(void *data) {
result = dns_dbiterator_seek(updbit, name); result = dns_dbiterator_seek(updbit, name);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
dns_dbiterator_destroy(&updbit); dns_dbiterator_destroy(&updbit);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, ISC_LOG_ERROR,
"catz: zone '%s' has no 'version' record (%s) " "catz: zone '%s' has no 'version' record (%s) "
"and will not be processed", "and will not be processed",
bname, isc_result_totext(result)); bname, isc_result_totext(result));
@ -2350,7 +2350,7 @@ dns__catz_update_cb(void *data) {
result = dns_dbiterator_current(updbit, &node, name); result = dns_dbiterator_current(updbit, &node, name);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, DNS_LOGMODULE_MASTER, ISC_LOG_ERROR,
"catz: failed to get db iterator - %s", "catz: failed to get db iterator - %s",
isc_result_totext(result)); isc_result_totext(result));
@ -2373,7 +2373,7 @@ dns__catz_update_cb(void *data) {
result = dns_db_allrdatasets(updb, node, oldcatz->updbversion, result = dns_db_allrdatasets(updb, node, oldcatz->updbversion,
0, 0, &rdsiter); 0, 0, &rdsiter);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, DNS_LOGMODULE_MASTER, ISC_LOG_ERROR,
"catz: failed to fetch rrdatasets - %s", "catz: failed to fetch rrdatasets - %s",
isc_result_totext(result)); isc_result_totext(result));
@ -2417,7 +2417,7 @@ dns__catz_update_cb(void *data) {
sizeof(classbuf)); sizeof(classbuf));
dns_rdatatype_format(rdataset.type, typebuf, dns_rdatatype_format(rdataset.type, typebuf,
sizeof(typebuf)); sizeof(typebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, DNS_LOGMODULE_MASTER,
ISC_LOG_WARNING, ISC_LOG_WARNING,
"catz: invalid record in catalog " "catz: invalid record in catalog "
@ -2443,7 +2443,7 @@ dns__catz_update_cb(void *data) {
} }
dns_dbiterator_destroy(&updbit); dns_dbiterator_destroy(&updbit);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3),
"catz: update_from_db: iteration finished: %s", "catz: update_from_db: iteration finished: %s",
isc_result_totext(result)); isc_result_totext(result));
@ -2455,13 +2455,13 @@ dns__catz_update_cb(void *data) {
? oldcatz->version ? oldcatz->version
: newcatz->version; : newcatz->version;
if (catz_vers == DNS_CATZ_VERSION_UNDEFINED) { if (catz_vers == DNS_CATZ_VERSION_UNDEFINED) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_WARNING, ISC_LOG_WARNING,
"catz: zone '%s' version is not set", bname); "catz: zone '%s' version is not set", bname);
newcatz->broken = true; newcatz->broken = true;
} else if (catz_vers != 1 && catz_vers != 2) { } else if (catz_vers != 1 && catz_vers != 2) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_WARNING, ISC_LOG_WARNING,
"catz: zone '%s' unsupported version " "catz: zone '%s' unsupported version "
"'%" PRIu32 "'", "'%" PRIu32 "'",
bname, catz_vers); bname, catz_vers);
@ -2472,8 +2472,8 @@ dns__catz_update_cb(void *data) {
if (newcatz->broken) { if (newcatz->broken) {
dns_name_format(name, cname, DNS_NAME_FORMATSIZE); dns_name_format(name, cname, DNS_NAME_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, ISC_LOG_ERROR,
"catz: new catalog zone '%s' is broken and " "catz: new catalog zone '%s' is broken and "
"will not be processed", "will not be processed",
bname); bname);
@ -2488,15 +2488,14 @@ dns__catz_update_cb(void *data) {
result = dns__catz_zones_merge(oldcatz, newcatz); result = dns__catz_zones_merge(oldcatz, newcatz);
dns_catz_zone_detach(&newcatz); dns_catz_zone_detach(&newcatz);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, ISC_LOG_ERROR, "catz: failed merging zones: %s",
"catz: failed merging zones: %s",
isc_result_totext(result)); isc_result_totext(result));
goto exit; goto exit;
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3),
"catz: update_from_db: new zone merged"); "catz: update_from_db: new zone merged");
@ -2526,7 +2525,7 @@ dns__catz_done_cb(void *data) {
UNLOCK(&catz->catzs->lock); UNLOCK(&catz->catzs->lock);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
ISC_LOG_INFO, "catz: %s: reload done: %s", dname, ISC_LOG_INFO, "catz: %s: reload done: %s", dname,
isc_result_totext(catz->updateresult)); isc_result_totext(catz->updateresult));
@ -2572,7 +2571,7 @@ dns_catz_postreconfig(dns_catz_zones_t *catzs) {
char cname[DNS_NAME_FORMATSIZE]; char cname[DNS_NAME_FORMATSIZE];
dns_name_format(&catz->name, cname, dns_name_format(&catz->name, cname,
DNS_NAME_FORMATSIZE); DNS_NAME_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_WARNING, DNS_LOGMODULE_MASTER, ISC_LOG_WARNING,
"catz: removing catalog zone %s", cname); "catz: removing catalog zone %s", cname);

View File

@ -158,8 +158,8 @@ dns_db_create(isc_mem_t *mctx, const char *db_type, const dns_name_t *origin,
RWUNLOCK(&implock, isc_rwlocktype_read); RWUNLOCK(&implock, isc_rwlocktype_read);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DB, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DB, ISC_LOG_ERROR,
ISC_LOG_ERROR, "unsupported database type '%s'", db_type); "unsupported database type '%s'", db_type);
return (ISC_R_NOTFOUND); return (ISC_R_NOTFOUND);
} }

View File

@ -42,9 +42,6 @@
goto failure; \ goto failure; \
} while (0) } while (0)
#define DIFF_COMMON_LOGARGS \
dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_DIFF
static dns_rdatatype_t static dns_rdatatype_t
rdata_covers(dns_rdata_t *rdata) { rdata_covers(dns_rdata_t *rdata) {
return (rdata->type == dns_rdatatype_rrsig ? dns_rdata_covers(rdata) return (rdata->type == dns_rdatatype_rrsig ? dns_rdata_covers(rdata)
@ -346,7 +343,8 @@ diff_apply(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver, bool warn) {
dns_rdataclass_format(t->rdata.rdclass, dns_rdataclass_format(t->rdata.rdclass,
classbuf, classbuf,
sizeof(classbuf)); sizeof(classbuf));
isc_log_write(DIFF_COMMON_LOGARGS, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DIFF,
ISC_LOG_WARNING, ISC_LOG_WARNING,
"'%s/%s/%s': TTL differs " "'%s/%s/%s': TTL differs "
"in " "in "
@ -428,7 +426,8 @@ diff_apply(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver, bool warn) {
dns_rdataclass_format(dns_db_class(db), dns_rdataclass_format(dns_db_class(db),
classbuf, classbuf,
sizeof(classbuf)); sizeof(classbuf));
isc_log_write(DIFF_COMMON_LOGARGS, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DIFF,
ISC_LOG_WARNING, ISC_LOG_WARNING,
"%s/%s: dns_diff_apply: " "%s/%s: dns_diff_apply: "
"update with no effect", "update with no effect",
@ -465,7 +464,8 @@ diff_apply(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver, bool warn) {
dns_rdataclass_format(rdclass, classbuf, dns_rdataclass_format(rdclass, classbuf,
sizeof(classbuf)); sizeof(classbuf));
isc_log_write( isc_log_write(
DIFF_COMMON_LOGARGS, DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DIFF,
ISC_LOG_ERROR, ISC_LOG_ERROR,
"dns_diff_apply: %s/%s/%s: %s " "dns_diff_apply: %s/%s/%s: %s "
"%s", "%s",
@ -557,7 +557,8 @@ dns_diff_load(dns_diff_t *diff, dns_rdatacallbacks_t *callbacks) {
result = callbacks->add(callbacks->add_private, name, result = callbacks->add(callbacks->add_private, name,
&rds DNS__DB_FILELINE); &rds DNS__DB_FILELINE);
if (result == DNS_R_UNCHANGED) { if (result == DNS_R_UNCHANGED) {
isc_log_write(DIFF_COMMON_LOGARGS, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DIFF,
ISC_LOG_WARNING, ISC_LOG_WARNING,
"dns_diff_load: " "dns_diff_load: "
"update with no effect"); "update with no effect");
@ -707,7 +708,8 @@ dns_diff_print(dns_diff_t *diff, FILE *file) {
fprintf(file, "%s %.*s\n", op, (int)r.length, fprintf(file, "%s %.*s\n", op, (int)r.length,
(char *)r.base); (char *)r.base);
} else { } else {
isc_log_write(DIFF_COMMON_LOGARGS, ISC_LOG_DEBUG(7), isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DIFF, ISC_LOG_DEBUG(7),
"%s %.*s", op, (int)r.length, "%s %.*s", op, (int)r.length,
(char *)r.base); (char *)r.base);
} }

View File

@ -250,7 +250,7 @@ mgr_log(dns_dispatchmgr_t *mgr, int level, const char *fmt, ...) {
char msgbuf[2048]; char msgbuf[2048];
va_list ap; va_list ap;
if (!isc_log_wouldlog(dns_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
@ -258,9 +258,8 @@ mgr_log(dns_dispatchmgr_t *mgr, int level, const char *fmt, ...) {
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
va_end(ap); va_end(ap);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DISPATCH, isc_log_write(DNS_LOGCATEGORY_DISPATCH, DNS_LOGMODULE_DISPATCH, level,
DNS_LOGMODULE_DISPATCH, level, "dispatchmgr %p: %s", mgr, "dispatchmgr %p: %s", mgr, msgbuf);
msgbuf);
} }
static void static void
@ -287,7 +286,7 @@ dispatch_log(dns_dispatch_t *disp, int level, const char *fmt, ...) {
va_list ap; va_list ap;
int r; int r;
if (!isc_log_wouldlog(dns_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
@ -301,9 +300,8 @@ dispatch_log(dns_dispatch_t *disp, int level, const char *fmt, ...) {
} }
va_end(ap); va_end(ap);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DISPATCH, isc_log_write(DNS_LOGCATEGORY_DISPATCH, DNS_LOGMODULE_DISPATCH, level,
DNS_LOGMODULE_DISPATCH, level, "dispatch %p: %s", disp, "dispatch %p: %s", disp, msgbuf);
msgbuf);
} }
static void static void
@ -316,7 +314,7 @@ dispentry_log(dns_dispentry_t *resp, int level, const char *fmt, ...) {
va_list ap; va_list ap;
int r; int r;
if (!isc_log_wouldlog(dns_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
@ -536,7 +534,7 @@ udp_recv(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
NULL) == ISC_R_SUCCESS && NULL) == ISC_R_SUCCESS &&
match > 0) match > 0)
{ {
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(10))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(10))) {
char netaddrstr[ISC_NETADDR_FORMATSIZE]; char netaddrstr[ISC_NETADDR_FORMATSIZE];
isc_netaddr_format(&netaddr, netaddrstr, isc_netaddr_format(&netaddr, netaddrstr,
sizeof(netaddrstr)); sizeof(netaddrstr));
@ -1195,7 +1193,7 @@ dns_dispatch_createtcp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *localaddr,
rcu_read_unlock(); rcu_read_unlock();
} }
if (isc_log_wouldlog(dns_lctx, 90)) { if (isc_log_wouldlog(90)) {
char addrbuf[ISC_SOCKADDR_FORMATSIZE]; char addrbuf[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(&disp->local, addrbuf, isc_sockaddr_format(&disp->local, addrbuf,
@ -1331,7 +1329,7 @@ dispatch_createudp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *localaddr,
dispatch_allocate(mgr, isc_socktype_udp, tid, &disp); dispatch_allocate(mgr, isc_socktype_udp, tid, &disp);
if (isc_log_wouldlog(dns_lctx, 90)) { if (isc_log_wouldlog(90)) {
char addrbuf[ISC_SOCKADDR_FORMATSIZE]; char addrbuf[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(localaddr, addrbuf, isc_sockaddr_format(localaddr, addrbuf,
@ -1794,7 +1792,7 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
dns_dispentry_t *next = NULL; dns_dispentry_t *next = NULL;
dns_displist_t resps = ISC_LIST_INITIALIZER; dns_displist_t resps = ISC_LIST_INITIALIZER;
if (isc_log_wouldlog(dns_lctx, 90)) { if (isc_log_wouldlog(90)) {
char localbuf[ISC_SOCKADDR_FORMATSIZE]; char localbuf[ISC_SOCKADDR_FORMATSIZE];
char peerbuf[ISC_SOCKADDR_FORMATSIZE]; char peerbuf[ISC_SOCKADDR_FORMATSIZE];
if (handle != NULL) { if (handle != NULL) {

View File

@ -177,9 +177,8 @@ dns_dlzcreate(isc_mem_t *mctx, const char *dlzname, const char *drivername,
REQUIRE(mctx != NULL); REQUIRE(mctx != NULL);
/* write log message */ /* write log message */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, ISC_LOG_INFO,
ISC_LOG_INFO, "Loading '%s' using driver %s", dlzname, "Loading '%s' using driver %s", dlzname, drivername);
drivername);
/* lock the dlz_implementations list so we can search it. */ /* lock the dlz_implementations list so we can search it. */
RWLOCK(&dlz_implock, isc_rwlocktype_read); RWLOCK(&dlz_implock, isc_rwlocktype_read);
@ -189,8 +188,8 @@ dns_dlzcreate(isc_mem_t *mctx, const char *dlzname, const char *drivername,
if (impinfo == NULL) { if (impinfo == NULL) {
RWUNLOCK(&dlz_implock, isc_rwlocktype_read); RWUNLOCK(&dlz_implock, isc_rwlocktype_read);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ,
DNS_LOGMODULE_DLZ, ISC_LOG_ERROR, ISC_LOG_ERROR,
"unsupported DLZ database driver '%s'." "unsupported DLZ database driver '%s'."
" %s not loaded.", " %s not loaded.",
drivername, dlzname); drivername, dlzname);
@ -221,12 +220,12 @@ dns_dlzcreate(isc_mem_t *mctx, const char *dlzname, const char *drivername,
db->magic = DNS_DLZ_MAGIC; db->magic = DNS_DLZ_MAGIC;
isc_mem_attach(mctx, &db->mctx); isc_mem_attach(mctx, &db->mctx);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ,
ISC_LOG_DEBUG(2), "DLZ driver loaded successfully."); ISC_LOG_DEBUG(2), "DLZ driver loaded successfully.");
*dbp = db; *dbp = db;
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
failure: failure:
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ,
ISC_LOG_ERROR, "DLZ driver failed to load."); ISC_LOG_ERROR, "DLZ driver failed to load.");
/* impinfo->methods->create failed. */ /* impinfo->methods->create failed. */
@ -241,7 +240,7 @@ dns_dlzdestroy(dns_dlzdb_t **dbp) {
dns_dlzdb_t *db; dns_dlzdb_t *db;
/* Write debugging message to log */ /* Write debugging message to log */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ,
ISC_LOG_DEBUG(2), "Unloading DLZ driver."); ISC_LOG_DEBUG(2), "Unloading DLZ driver.");
/* /*
@ -277,7 +276,7 @@ dns_dlzregister(const char *drivername, const dns_dlzmethods_t *methods,
dns_dlzimplementation_t *dlz_imp; dns_dlzimplementation_t *dlz_imp;
/* Write debugging message to log */ /* Write debugging message to log */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ,
ISC_LOG_DEBUG(2), "Registering DLZ driver '%s'", ISC_LOG_DEBUG(2), "Registering DLZ driver '%s'",
drivername); drivername);
@ -307,8 +306,8 @@ dns_dlzregister(const char *drivername, const dns_dlzmethods_t *methods,
*/ */
dlz_imp = dlz_impfind(drivername); dlz_imp = dlz_impfind(drivername);
if (dlz_imp != NULL) { if (dlz_imp != NULL) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ,
DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(2), ISC_LOG_DEBUG(2),
"DLZ Driver '%s' already registered", drivername); "DLZ Driver '%s' already registered", drivername);
RWUNLOCK(&dlz_implock, isc_rwlocktype_write); RWUNLOCK(&dlz_implock, isc_rwlocktype_write);
return (ISC_R_EXISTS); return (ISC_R_EXISTS);
@ -365,7 +364,7 @@ dns_dlzunregister(dns_dlzimplementation_t **dlzimp) {
dns_dlzimplementation_t *dlz_imp; dns_dlzimplementation_t *dlz_imp;
/* Write debugging message to log */ /* Write debugging message to log */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ,
ISC_LOG_DEBUG(2), "Unregistering DLZ driver."); ISC_LOG_DEBUG(2), "Unregistering DLZ driver.");
/* /*
@ -431,8 +430,8 @@ dns_dlz_writeablezone(dns_view_t *view, dns_dlzdb_t *dlzdb,
origin = dns_fixedname_name(&fixorigin); origin = dns_fixedname_name(&fixorigin);
if (!dlzdb->search) { if (!dlzdb->search) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ,
DNS_LOGMODULE_DLZ, ISC_LOG_WARNING, ISC_LOG_WARNING,
"DLZ %s has 'search no;', but attempted to " "DLZ %s has 'search no;', but attempted to "
"register writeable zone %s.", "register writeable zone %s.",
dlzdb->dlzname, zone_name); dlzdb->dlzname, zone_name);
@ -518,8 +517,8 @@ dns_dlz_ssumatch(dns_dlzdb_t *dlzdatabase, const dns_name_t *signer,
impl = dlzdatabase->implementation; impl = dlzdatabase->implementation;
if (impl->methods->ssumatch == NULL) { if (impl->methods->ssumatch == NULL) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ,
DNS_LOGMODULE_DLZ, ISC_LOG_INFO, ISC_LOG_INFO,
"No ssumatch method for DLZ database"); "No ssumatch method for DLZ database");
return (false); return (false);
} }

View File

@ -120,8 +120,8 @@ dnsrps_log_fnc(librpz_log_level_t level, void *ctxt, const char *buf) {
isc_level = DNS_RPZ_ERROR_LEVEL; isc_level = DNS_RPZ_ERROR_LEVEL;
break; break;
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB, isc_level,
isc_level, "dnsrps: %s", buf); "dnsrps: %s", buf);
} }
/* /*
@ -150,12 +150,10 @@ dns_dnsrps_server_create(const char *librpz_path) {
librpz->set_log(dnsrps_log_fnc, NULL); librpz->set_log(dnsrps_log_fnc, NULL);
clist = librpz->clist_create(&emsg, dnsrps_lock, dnsrps_unlock, clist = librpz->clist_create(&emsg, dnsrps_lock, dnsrps_unlock,
dnsrps_mutex_destroy, &dnsrps_mutex, dnsrps_mutex_destroy, &dnsrps_mutex, NULL);
dns_lctx);
if (clist == NULL) { if (clist == NULL) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_LOGMODULE_RBTDB, DNS_RPZ_ERROR_LEVEL, DNS_RPZ_ERROR_LEVEL, "dnsrps: %s", emsg.c);
"dnsrps: %s", emsg.c);
return (ISC_R_NOMEMORY); return (ISC_R_NOMEMORY);
} }
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
@ -175,8 +173,8 @@ dns_dnsrps_server_destroy(void) {
if (librpz != NULL) { if (librpz != NULL) {
INSIST(librpz_handle != NULL); INSIST(librpz_handle != NULL);
if (dlclose(librpz_handle) != 0) { if (dlclose(librpz_handle) != 0) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_LOGMODULE_RBTDB, DNS_RPZ_ERROR_LEVEL, DNS_RPZ_ERROR_LEVEL,
"dnsrps: dlclose(): %s", dlerror()); "dnsrps: dlclose(): %s", dlerror());
} }
librpz_handle = NULL; librpz_handle = NULL;
@ -192,14 +190,14 @@ isc_result_t
dns_dnsrps_view_init(dns_rpz_zones_t *new, char *rps_cstr) { dns_dnsrps_view_init(dns_rpz_zones_t *new, char *rps_cstr) {
librpz_emsg_t emsg; librpz_emsg_t emsg;
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_RPZ_DEBUG_LEVEL3, "dnsrps configuration \"%s\"", DNS_RPZ_DEBUG_LEVEL3, "dnsrps configuration \"%s\"",
rps_cstr); rps_cstr);
new->rps_client = librpz->client_create(&emsg, clist, rps_cstr, false); new->rps_client = librpz->client_create(&emsg, clist, rps_cstr, false);
if (new->rps_client == NULL) { if (new->rps_client == NULL) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_LOGMODULE_RBTDB, DNS_RPZ_ERROR_LEVEL, DNS_RPZ_ERROR_LEVEL,
"librpz->client_create(): %s", emsg.c); "librpz->client_create(): %s", emsg.c);
new->p.dnsrps_enabled = false; new->p.dnsrps_enabled = false;
return (ISC_R_FAILURE); return (ISC_R_FAILURE);
@ -224,20 +222,20 @@ dns_dnsrps_connect(dns_rpz_zones_t *rpzs) {
* Fail only if we failed to link to librpz. * Fail only if we failed to link to librpz.
*/ */
if (librpz == NULL) { if (librpz == NULL) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_LOGMODULE_RBTDB, DNS_RPZ_ERROR_LEVEL, DNS_RPZ_ERROR_LEVEL, "librpz->connect(): %s",
"librpz->connect(): %s", librpz_lib_open_emsg.c); librpz_lib_open_emsg.c);
return (ISC_R_FAILURE); return (ISC_R_FAILURE);
} }
if (!librpz->connect(&emsg, rpzs->rps_client, true)) { if (!librpz->connect(&emsg, rpzs->rps_client, true)) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_LOGMODULE_RBTDB, DNS_RPZ_ERROR_LEVEL, DNS_RPZ_ERROR_LEVEL, "librpz->connect(): %s",
"librpz->connect(): %s", emsg.c); emsg.c);
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_RPZ_INFO_LEVEL, "dnsrps: librpz version %s", DNS_RPZ_INFO_LEVEL, "dnsrps: librpz version %s",
librpz->version); librpz->version);

View File

@ -562,8 +562,8 @@ again:
if (ret == ISC_R_SUCCESS && downcase) { if (ret == ISC_R_SUCCESS && downcase) {
char namebuf[DNS_NAME_FORMATSIZE]; char namebuf[DNS_NAME_FORMATSIZE];
dns_name_format(&sig.signer, namebuf, sizeof(namebuf)); dns_name_format(&sig.signer, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1),
"successfully validated after lower casing " "successfully validated after lower casing "
"signer '%s'", "signer '%s'",
namebuf); namebuf);
@ -1307,7 +1307,7 @@ findmatchingkeys(const char *directory, char *namebuf, unsigned int len,
} }
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING, DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING,
"dns_dnssec_findmatchingkeys: " "dns_dnssec_findmatchingkeys: "
"error reading key file %s: %s", "error reading key file %s: %s",
@ -1659,7 +1659,7 @@ dns_dnssec_keylistfromrdataset(const dns_name_t *origin, dns_kasp_t *kasp,
algbuf, dst_key_id(dnskey)); algbuf, dst_key_id(dnskey));
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING, DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING,
"dns_dnssec_keylistfromrdataset: error " "dns_dnssec_keylistfromrdataset: error "
"reading %s: %s", "reading %s: %s",
@ -1861,8 +1861,8 @@ add_cds(dns_dnsseckey_t *key, dns_rdata_t *keyrdata, const char *keystr,
char algbuf[DNS_DSDIGEST_FORMATSIZE]; char algbuf[DNS_DSDIGEST_FORMATSIZE];
dns_dsdigest_format(digesttype, algbuf, dns_dsdigest_format(digesttype, algbuf,
DNS_DSDIGEST_FORMATSIZE); DNS_DSDIGEST_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_ERROR, ISC_LOG_ERROR,
"build rdata CDS (%s) for key %s failed", algbuf, "build rdata CDS (%s) for key %s failed", algbuf,
keystr); keystr);
return (r); return (r);
@ -1873,8 +1873,8 @@ add_cds(dns_dnsseckey_t *key, dns_rdata_t *keyrdata, const char *keystr,
char algbuf[DNS_DSDIGEST_FORMATSIZE]; char algbuf[DNS_DSDIGEST_FORMATSIZE];
dns_dsdigest_format(digesttype, algbuf, dns_dsdigest_format(digesttype, algbuf,
DNS_DSDIGEST_FORMATSIZE); DNS_DSDIGEST_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, ISC_LOG_INFO,
"CDS (%s) for key %s is now published", algbuf, "CDS (%s) for key %s is now published", algbuf,
keystr); keystr);
addrdata(&cdsrdata, diff, origin, ttl, mctx); addrdata(&cdsrdata, diff, origin, ttl, mctx);
@ -1901,8 +1901,8 @@ delete_cds(dns_dnsseckey_t *key, dns_rdata_t *keyrdata, const char *keystr,
char algbuf[DNS_DSDIGEST_FORMATSIZE]; char algbuf[DNS_DSDIGEST_FORMATSIZE];
dns_dsdigest_format(digesttype, algbuf, dns_dsdigest_format(digesttype, algbuf,
DNS_DSDIGEST_FORMATSIZE); DNS_DSDIGEST_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, ISC_LOG_INFO,
"CDS (%s) for key %s is now deleted", algbuf, "CDS (%s) for key %s is now deleted", algbuf,
keystr); keystr);
delrdata(&cdsrdata, diff, origin, cds->ttl, mctx); delrdata(&cdsrdata, diff, origin, cds->ttl, mctx);
@ -1962,7 +1962,7 @@ dns_dnssec_syncupdate(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *rmkeys,
!exists(cdnskey, &cdnskeyrdata))) !exists(cdnskey, &cdnskeyrdata)))
{ {
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
"CDNSKEY for key %s is now published", "CDNSKEY for key %s is now published",
keystr); keystr);
@ -1990,8 +1990,7 @@ dns_dnssec_syncupdate(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *rmkeys,
if (dns_rdataset_isassociated(cdnskey)) { if (dns_rdataset_isassociated(cdnskey)) {
if (exists(cdnskey, &cdnskeyrdata)) { if (exists(cdnskey, &cdnskeyrdata)) {
isc_log_write(dns_lctx, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DNSSEC, DNS_LOGMODULE_DNSSEC,
ISC_LOG_INFO, ISC_LOG_INFO,
"CDNSKEY for key %s is " "CDNSKEY for key %s is "
@ -2037,7 +2036,7 @@ dns_dnssec_syncupdate(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *rmkeys,
if (dns_rdataset_isassociated(cdnskey)) { if (dns_rdataset_isassociated(cdnskey)) {
if (exists(cdnskey, &cdnskeyrdata)) { if (exists(cdnskey, &cdnskeyrdata)) {
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
"CDNSKEY for key %s is now deleted", "CDNSKEY for key %s is now deleted",
keystr); keystr);
@ -2080,7 +2079,7 @@ dns_dnssec_syncdelete(dns_rdataset_t *cds, dns_rdataset_t *cdnskey,
if (!dns_rdataset_isassociated(cds) || if (!dns_rdataset_isassociated(cds) ||
!exists(cds, &cds_delete)) !exists(cds, &cds_delete))
{ {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
"CDS (DELETE) for zone %s is now " "CDS (DELETE) for zone %s is now "
"published", "published",
@ -2090,7 +2089,7 @@ dns_dnssec_syncdelete(dns_rdataset_t *cds, dns_rdataset_t *cdnskey,
} else { } else {
if (dns_rdataset_isassociated(cds) && exists(cds, &cds_delete)) if (dns_rdataset_isassociated(cds) && exists(cds, &cds_delete))
{ {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
"CDS (DELETE) for zone %s is now " "CDS (DELETE) for zone %s is now "
"deleted", "deleted",
@ -2103,7 +2102,7 @@ dns_dnssec_syncdelete(dns_rdataset_t *cds, dns_rdataset_t *cdnskey,
if (!dns_rdataset_isassociated(cdnskey) || if (!dns_rdataset_isassociated(cdnskey) ||
!exists(cdnskey, &cdnskey_delete)) !exists(cdnskey, &cdnskey_delete))
{ {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
"CDNSKEY (DELETE) for zone %s is now " "CDNSKEY (DELETE) for zone %s is now "
"published", "published",
@ -2114,7 +2113,7 @@ dns_dnssec_syncdelete(dns_rdataset_t *cds, dns_rdataset_t *cdnskey,
if (dns_rdataset_isassociated(cdnskey) && if (dns_rdataset_isassociated(cdnskey) &&
exists(cdnskey, &cdnskey_delete)) exists(cdnskey, &cdnskey_delete))
{ {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
"CDNSKEY (DELETE) for zone %s is now " "CDNSKEY (DELETE) for zone %s is now "
"deleted", "deleted",
@ -2236,7 +2235,7 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
RETERR(publish_key(diff, key1, origin, ttl, RETERR(publish_key(diff, key1, origin, ttl,
mctx, report)); mctx, report));
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
"DNSKEY %s (%s) is now published", "DNSKEY %s (%s) is now published",
keystr1, keystr1,
@ -2245,7 +2244,6 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
if (key1->hint_sign || key1->force_sign) { if (key1->hint_sign || key1->force_sign) {
key1->first_sign = true; key1->first_sign = true;
isc_log_write( isc_log_write(
dns_lctx,
DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, DNS_LOGMODULE_DNSSEC,
ISC_LOG_INFO, ISC_LOG_INFO,
@ -2276,7 +2274,7 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
if (removed != NULL) { if (removed != NULL) {
ISC_LIST_APPEND(*removed, key2, link); ISC_LIST_APPEND(*removed, key2, link);
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
"DNSKEY %s (%s) is now deleted", "DNSKEY %s (%s) is now deleted",
keystr2, keystr2,
@ -2299,7 +2297,7 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
if (removed != NULL) { if (removed != NULL) {
ISC_LIST_APPEND(*removed, key2, link); ISC_LIST_APPEND(*removed, key2, link);
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
"DNSKEY %s (%s) is now revoked; " "DNSKEY %s (%s) is now revoked; "
"new ID is %05d", "new ID is %05d",
@ -2332,7 +2330,7 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
{ {
key2->first_sign = true; key2->first_sign = true;
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
"DNSKEY %s (%s) is now active", keystr1, "DNSKEY %s (%s) is now active", keystr1,
key1->ksk ? (key1->zsk ? "CSK" : "KSK") key1->ksk ? (key1->zsk ? "CSK" : "KSK")
@ -2341,7 +2339,7 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
!key1->force_sign) !key1->force_sign)
{ {
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
"DNSKEY %s (%s) is now inactive", "DNSKEY %s (%s) is now inactive",
keystr1, keystr1,

View File

@ -153,7 +153,7 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
REQUIRE(envp != NULL && *envp == NULL); REQUIRE(envp != NULL && *envp == NULL);
REQUIRE(foptp != NULL && *foptp != NULL); REQUIRE(foptp != NULL && *foptp != NULL);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSTAP, DNS_LOGMODULE_DNSTAP, isc_log_write(DNS_LOGCATEGORY_DNSTAP, DNS_LOGMODULE_DNSTAP,
ISC_LOG_INFO, "opening dnstap destination '%s'", path); ISC_LOG_INFO, "opening dnstap destination '%s'", path);
atomic_fetch_add_release(&global_generation, 1); atomic_fetch_add_release(&global_generation, 1);
@ -204,8 +204,8 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
env->iothr = fstrm_iothr_init(*foptp, &fw); env->iothr = fstrm_iothr_init(*foptp, &fw);
if (env->iothr == NULL) { if (env->iothr == NULL) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSTAP, isc_log_write(DNS_LOGCATEGORY_DNSTAP, DNS_LOGMODULE_DNSTAP,
DNS_LOGMODULE_DNSTAP, ISC_LOG_WARNING, ISC_LOG_WARNING,
"unable to initialize dnstap I/O thread"); "unable to initialize dnstap I/O thread");
fstrm_writer_destroy(&fw); fstrm_writer_destroy(&fw);
CHECK(ISC_R_FAILURE); CHECK(ISC_R_FAILURE);
@ -324,7 +324,7 @@ dns_dt_reopen(dns_dtenv_t *env, int roll) {
/* /*
* We are committed here. * We are committed here.
*/ */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSTAP, DNS_LOGMODULE_DNSTAP, isc_log_write(DNS_LOGCATEGORY_DNSTAP, DNS_LOGMODULE_DNSTAP,
ISC_LOG_INFO, "%s dnstap destination '%s'", ISC_LOG_INFO, "%s dnstap destination '%s'",
(roll < 0) ? "reopening" : "rolling", env->path); (roll < 0) ? "reopening" : "rolling", env->path);
@ -357,8 +357,8 @@ dns_dt_reopen(dns_dtenv_t *env, int roll) {
env->iothr = fstrm_iothr_init(env->fopt, &fw); env->iothr = fstrm_iothr_init(env->fopt, &fw);
if (env->iothr == NULL) { if (env->iothr == NULL) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSTAP, isc_log_write(DNS_LOGCATEGORY_DNSTAP, DNS_LOGMODULE_DNSTAP,
DNS_LOGMODULE_DNSTAP, ISC_LOG_WARNING, ISC_LOG_WARNING,
"unable to initialize dnstap I/O thread"); "unable to initialize dnstap I/O thread");
CHECK(ISC_R_FAILURE); CHECK(ISC_R_FAILURE);
} }
@ -474,7 +474,7 @@ dns_dt_getstats(dns_dtenv_t *env, isc_stats_t **statsp) {
static void static void
destroy(dns_dtenv_t *env) { destroy(dns_dtenv_t *env) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSTAP, DNS_LOGMODULE_DNSTAP, isc_log_write(DNS_LOGCATEGORY_DNSTAP, DNS_LOGMODULE_DNSTAP,
ISC_LOG_INFO, "closing dnstap"); ISC_LOG_INFO, "closing dnstap");
env->magic = 0; env->magic = 0;
@ -815,9 +815,9 @@ dns_dt_send(dns_view_t *view, dns_dtmsgtype_t msgtype, isc_sockaddr_t *qaddr,
dm.m.has_query_time_nsec = 1; dm.m.has_query_time_nsec = 1;
break; break;
default: default:
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSTAP, isc_log_write(DNS_LOGCATEGORY_DNSTAP, DNS_LOGMODULE_DNSTAP,
DNS_LOGMODULE_DNSTAP, ISC_LOG_ERROR, ISC_LOG_ERROR, "invalid dnstap message type %d",
"invalid dnstap message type %d", msgtype); msgtype);
return; return;
} }

View File

@ -620,8 +620,8 @@ dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv,
int level; int level;
level = ISC_LOG_WARNING; level = ISC_LOG_WARNING;
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, level, level,
"Permissions on the file %s " "Permissions on the file %s "
"have changed from 0%o to 0600 as " "have changed from 0%o to 0600 as "
"a result of this operation.", "a result of this operation.",

View File

@ -94,8 +94,8 @@ load_symbol(uv_lib_t *handle, const char *filename, const char *symbol_name,
if (errmsg == NULL) { if (errmsg == NULL) {
errmsg = "returned function pointer is NULL"; errmsg = "returned function pointer is NULL";
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB,
DNS_LOGMODULE_DYNDB, ISC_LOG_ERROR, ISC_LOG_ERROR,
"failed to lookup symbol %s in " "failed to lookup symbol %s in "
"DynDB module '%s': %s", "DynDB module '%s': %s",
symbol_name, filename, errmsg); symbol_name, filename, errmsg);
@ -121,7 +121,7 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
REQUIRE(impp != NULL && *impp == NULL); REQUIRE(impp != NULL && *impp == NULL);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB,
ISC_LOG_INFO, "loading DynDB instance '%s' driver '%s'", ISC_LOG_INFO, "loading DynDB instance '%s' driver '%s'",
instname, filename); instname, filename);
@ -140,8 +140,8 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
if (errmsg == NULL) { if (errmsg == NULL) {
errmsg = "unknown error"; errmsg = "unknown error";
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB,
DNS_LOGMODULE_DYNDB, ISC_LOG_ERROR, ISC_LOG_ERROR,
"failed to dlopen() DynDB instance '%s' driver " "failed to dlopen() DynDB instance '%s' driver "
"'%s': %s", "'%s': %s",
instname, filename, errmsg); instname, filename, errmsg);
@ -155,8 +155,8 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
if (version < (DNS_DYNDB_VERSION - DNS_DYNDB_AGE) || if (version < (DNS_DYNDB_VERSION - DNS_DYNDB_AGE) ||
version > DNS_DYNDB_VERSION) version > DNS_DYNDB_VERSION)
{ {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB,
DNS_LOGMODULE_DYNDB, ISC_LOG_ERROR, ISC_LOG_ERROR,
"driver API version mismatch: %d/%d", version, "driver API version mismatch: %d/%d", version,
DNS_DYNDB_VERSION); DNS_DYNDB_VERSION);
CHECK(ISC_R_FAILURE); CHECK(ISC_R_FAILURE);
@ -172,7 +172,7 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
cleanup: cleanup:
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB,
ISC_LOG_ERROR, ISC_LOG_ERROR,
"failed to dynamically load DynDB instance '%s' driver " "failed to dynamically load DynDB instance '%s' driver "
"'%s': %s", "'%s': %s",
@ -250,9 +250,9 @@ dns_dyndb_cleanup(bool exiting) {
while (elem != NULL) { while (elem != NULL) {
prev = PREV(elem, link); prev = PREV(elem, link);
UNLINK(dyndb_implementations, elem, link); UNLINK(dyndb_implementations, elem, link);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB,
DNS_LOGMODULE_DYNDB, ISC_LOG_INFO, ISC_LOG_INFO, "unloading DynDB instance '%s'",
"unloading DynDB instance '%s'", elem->name); elem->name);
elem->destroy_func(&elem->inst); elem->destroy_func(&elem->inst);
ENSURE(elem->inst == NULL); ENSURE(elem->inst == NULL);
unload_library(&elem); unload_library(&elem);
@ -266,9 +266,9 @@ dns_dyndb_cleanup(bool exiting) {
} }
isc_result_t isc_result_t
dns_dyndb_createctx(isc_mem_t *mctx, const void *hashinit, isc_log_t *lctx, dns_dyndb_createctx(isc_mem_t *mctx, const void *hashinit, dns_view_t *view,
dns_view_t *view, dns_zonemgr_t *zmgr, dns_zonemgr_t *zmgr, isc_loopmgr_t *loopmgr,
isc_loopmgr_t *loopmgr, dns_dyndbctx_t **dctxp) { dns_dyndbctx_t **dctxp) {
dns_dyndbctx_t *dctx; dns_dyndbctx_t *dctx;
REQUIRE(dctxp != NULL && *dctxp == NULL); REQUIRE(dctxp != NULL && *dctxp == NULL);
@ -277,7 +277,6 @@ dns_dyndb_createctx(isc_mem_t *mctx, const void *hashinit, isc_log_t *lctx,
*dctx = (dns_dyndbctx_t){ *dctx = (dns_dyndbctx_t){
.loopmgr = loopmgr, .loopmgr = loopmgr,
.hashinit = hashinit, .hashinit = hashinit,
.lctx = lctx,
}; };
if (view != NULL) { if (view != NULL) {
@ -313,7 +312,6 @@ dns_dyndb_destroyctx(dns_dyndbctx_t **dctxp) {
dns_zonemgr_detach(&dctx->zmgr); dns_zonemgr_detach(&dctx->zmgr);
} }
dctx->loopmgr = NULL; dctx->loopmgr = NULL;
dctx->lctx = NULL;
isc_mem_putanddetach(&dctx->mctx, dctx, sizeof(*dctx)); isc_mem_putanddetach(&dctx->mctx, dctx, sizeof(*dctx));
} }

View File

@ -959,7 +959,7 @@ gss_log(int level, const char *fmt, ...) {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_TKEY, isc_log_vwrite(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_TKEY,
ISC_LOG_DEBUG(level), fmt, ap); ISC_LOG_DEBUG(level), fmt, ap);
va_end(ap); va_end(ap);
} }

View File

@ -104,7 +104,7 @@
isc_result_t result; \ isc_result_t result; \
result = hmac_parse(ISC_MD_##alg, key, lexer, pub); \ result = hmac_parse(ISC_MD_##alg, key, lexer, pub); \
if (result == ISC_R_SUCCESS && file != NULL) { \ if (result == ISC_R_SUCCESS && file != NULL) { \
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, \ isc_log_write(DNS_LOGCATEGORY_GENERAL, \
DNS_LOGMODULE_CRYPTO, ISC_LOG_WARNING, \ DNS_LOGMODULE_CRYPTO, ISC_LOG_WARNING, \
"%s: Use of K* file pairs for HMAC is " \ "%s: Use of K* file pairs for HMAC is " \
"deprecated\n", \ "deprecated\n", \

View File

@ -36,7 +36,6 @@ struct dns_dyndbctx {
unsigned int magic; unsigned int magic;
const void *hashinit; const void *hashinit;
isc_mem_t *mctx; isc_mem_t *mctx;
isc_log_t *lctx;
dns_view_t *view; dns_view_t *view;
dns_zonemgr_t *zmgr; dns_zonemgr_t *zmgr;
isc_loopmgr_t *loopmgr; isc_loopmgr_t *loopmgr;
@ -131,9 +130,9 @@ dns_dyndb_cleanup(bool exiting);
*/ */
isc_result_t isc_result_t
dns_dyndb_createctx(isc_mem_t *mctx, const void *hashinit, isc_log_t *lctx, dns_dyndb_createctx(isc_mem_t *mctx, const void *hashinit, dns_view_t *view,
dns_view_t *view, dns_zonemgr_t *zmgr, dns_zonemgr_t *zmgr, isc_loopmgr_t *loopmgr,
isc_loopmgr_t *loopmgr, dns_dyndbctx_t **dctxp); dns_dyndbctx_t **dctxp);
/*% /*%
* Create a dyndb initialization context structure, with * Create a dyndb initialization context structure, with
* pointers to structures in the server that the dyndb module will * pointers to structures in the server that the dyndb module will

View File

@ -19,7 +19,6 @@
#include <isc/lang.h> #include <isc/lang.h>
#include <isc/log.h> #include <isc/log.h>
extern isc_log_t *dns_lctx;
extern isc_logcategory_t dns_categories[]; extern isc_logcategory_t dns_categories[];
extern isc_logmodule_t dns_modules[]; extern isc_logmodule_t dns_modules[];
@ -85,7 +84,7 @@ extern isc_logmodule_t dns_modules[];
ISC_LANG_BEGINDECLS ISC_LANG_BEGINDECLS
void void
dns_log_init(isc_log_t *lctx); dns_log_init(void);
/*% /*%
* Make the libdns categories and modules available for use with the * Make the libdns categories and modules available for use with the
* ISC logging library. * ISC logging library.

View File

@ -365,9 +365,8 @@ dns_resolver_destroyfetch(dns_fetch_t **fetchp);
*/ */
void void
dns_resolver_logfetch(dns_fetch_t *fetch, isc_log_t *lctx, dns_resolver_logfetch(dns_fetch_t *fetch, isc_logcategory_t *category,
isc_logcategory_t *category, isc_logmodule_t *module, isc_logmodule_t *module, int level, bool duplicateok);
int level, bool duplicateok);
/*%< /*%<
* Dump a log message on internal state at the completion of given 'fetch'. * Dump a log message on internal state at the completion of given 'fetch'.
* 'lctx', 'category', 'module', and 'level' are used to write the log message. * 'lctx', 'category', 'module', and 'level' are used to write the log message.

View File

@ -81,11 +81,6 @@
* Miscellaneous utilities. * Miscellaneous utilities.
*/ */
#define JOURNAL_COMMON_LOGARGS \
dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL
#define JOURNAL_DEBUG_LOGARGS(n) JOURNAL_COMMON_LOGARGS, ISC_LOG_DEBUG(n)
/*% /*%
* It would be non-sensical (or at least obtuse) to use FAIL() with an * It would be non-sensical (or at least obtuse) to use FAIL() with an
* ISC_R_SUCCESS code, but the test is there to keep the Solaris compiler * ISC_R_SUCCESS code, but the test is there to keep the Solaris compiler
@ -417,8 +412,8 @@ journal_seek(dns_journal_t *j, uint32_t offset) {
result = isc_stdio_seek(j->fp, (off_t)offset, SEEK_SET); result = isc_stdio_seek(j->fp, (off_t)offset, SEEK_SET);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
"%s: seek: %s", j->filename, ISC_LOG_ERROR, "%s: seek: %s", j->filename,
isc_result_totext(result)); isc_result_totext(result));
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
@ -435,8 +430,8 @@ journal_read(dns_journal_t *j, void *mem, size_t nbytes) {
if (result == ISC_R_EOF) { if (result == ISC_R_EOF) {
return (ISC_R_NOMORE); return (ISC_R_NOMORE);
} }
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
"%s: read: %s", j->filename, ISC_LOG_ERROR, "%s: read: %s", j->filename,
isc_result_totext(result)); isc_result_totext(result));
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
@ -450,8 +445,8 @@ journal_write(dns_journal_t *j, void *mem, size_t nbytes) {
result = isc_stdio_write(mem, 1, nbytes, j->fp, NULL); result = isc_stdio_write(mem, 1, nbytes, j->fp, NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
"%s: write: %s", j->filename, ISC_LOG_ERROR, "%s: write: %s", j->filename,
isc_result_totext(result)); isc_result_totext(result));
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
@ -465,15 +460,15 @@ journal_fsync(dns_journal_t *j) {
result = isc_stdio_flush(j->fp); result = isc_stdio_flush(j->fp);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
"%s: flush: %s", j->filename, ISC_LOG_ERROR, "%s: flush: %s", j->filename,
isc_result_totext(result)); isc_result_totext(result));
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
result = isc_stdio_sync(j->fp); result = isc_stdio_sync(j->fp);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
"%s: fsync: %s", j->filename, ISC_LOG_ERROR, "%s: fsync: %s", j->filename,
isc_result_totext(result)); isc_result_totext(result));
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
@ -573,8 +568,8 @@ journal_file_create(isc_mem_t *mctx, bool downgrade, const char *filename) {
result = isc_stdio_open(filename, "wb", &fp); result = isc_stdio_open(filename, "wb", &fp);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
"%s: create: %s", filename, ISC_LOG_ERROR, "%s: create: %s", filename,
isc_result_totext(result)); isc_result_totext(result));
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
@ -595,8 +590,8 @@ journal_file_create(isc_mem_t *mctx, bool downgrade, const char *filename) {
result = isc_stdio_write(mem, 1, (size_t)size, fp, NULL); result = isc_stdio_write(mem, 1, (size_t)size, fp, NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
"%s: write: %s", filename, ISC_LOG_ERROR, "%s: write: %s", filename,
isc_result_totext(result)); isc_result_totext(result));
(void)isc_stdio_close(fp); (void)isc_stdio_close(fp);
(void)isc_file_remove(filename); (void)isc_file_remove(filename);
@ -607,8 +602,8 @@ journal_file_create(isc_mem_t *mctx, bool downgrade, const char *filename) {
result = isc_stdio_close(fp); result = isc_stdio_close(fp);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
"%s: close: %s", filename, ISC_LOG_ERROR, "%s: close: %s", filename,
isc_result_totext(result)); isc_result_totext(result));
(void)isc_file_remove(filename); (void)isc_file_remove(filename);
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
@ -636,7 +631,8 @@ journal_open(isc_mem_t *mctx, const char *filename, bool writable, bool create,
result = isc_stdio_open(j->filename, writable ? "rb+" : "rb", &fp); result = isc_stdio_open(j->filename, writable ? "rb+" : "rb", &fp);
if (result == ISC_R_FILENOTFOUND) { if (result == ISC_R_FILENOTFOUND) {
if (create) { if (create) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_DEBUG(1), isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_JOURNAL, ISC_LOG_DEBUG(1),
"journal file %s does not exist, " "journal file %s does not exist, "
"creating it", "creating it",
j->filename); j->filename);
@ -650,8 +646,8 @@ journal_open(isc_mem_t *mctx, const char *filename, bool writable, bool create,
} }
} }
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
"%s: open: %s", j->filename, ISC_LOG_ERROR, "%s: open: %s", j->filename,
isc_result_totext(result)); isc_result_totext(result));
FAIL(ISC_R_UNEXPECTED); FAIL(ISC_R_UNEXPECTED);
} }
@ -689,7 +685,8 @@ journal_open(isc_mem_t *mctx, const char *filename, bool writable, bool create,
*/ */
j->header_ver1 = false; j->header_ver1 = false;
} else { } else {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_ERROR,
"%s: journal format not recognized", j->filename); "%s: journal format not recognized", j->filename);
FAIL(ISC_R_UNEXPECTED); FAIL(ISC_R_UNEXPECTED);
} }
@ -870,7 +867,8 @@ maybe_fixup_xhdr(dns_journal_t *j, journal_xhdr_t *xhdr, uint32_t serial,
if (j->xhdr_version == XHDR_VERSION1 && xhdr->serial1 == serial) if (j->xhdr_version == XHDR_VERSION1 && xhdr->serial1 == serial)
{ {
isc_log_write( isc_log_write(
JOURNAL_COMMON_LOGARGS, ISC_LOG_DEBUG(3), DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_DEBUG(3),
"%s: XHDR_VERSION1 -> XHDR_VERSION2 at %u", "%s: XHDR_VERSION1 -> XHDR_VERSION2 at %u",
j->filename, serial); j->filename, serial);
j->xhdr_version = XHDR_VERSION2; j->xhdr_version = XHDR_VERSION2;
@ -881,7 +879,8 @@ maybe_fixup_xhdr(dns_journal_t *j, journal_xhdr_t *xhdr, uint32_t serial,
xhdr->count == serial) xhdr->count == serial)
{ {
isc_log_write( isc_log_write(
JOURNAL_COMMON_LOGARGS, ISC_LOG_DEBUG(3), DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_DEBUG(3),
"%s: XHDR_VERSION2 -> XHDR_VERSION1 at %u", "%s: XHDR_VERSION2 -> XHDR_VERSION1 at %u",
j->filename, serial); j->filename, serial);
j->xhdr_version = XHDR_VERSION1; j->xhdr_version = XHDR_VERSION1;
@ -901,7 +900,8 @@ maybe_fixup_xhdr(dns_journal_t *j, journal_xhdr_t *xhdr, uint32_t serial,
if (value != 0L) { if (value != 0L) {
CHECK(journal_seek(j, offset + 12)); CHECK(journal_seek(j, offset + 12));
} else { } else {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_DEBUG(3), isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_JOURNAL, ISC_LOG_DEBUG(3),
"%s: XHDR_VERSION1 count zero at %u", "%s: XHDR_VERSION1 count zero at %u",
j->filename, serial); j->filename, serial);
j->xhdr_version = XHDR_VERSION2; j->xhdr_version = XHDR_VERSION2;
@ -911,7 +911,8 @@ maybe_fixup_xhdr(dns_journal_t *j, journal_xhdr_t *xhdr, uint32_t serial,
xhdr->serial1 == 0U && xhdr->serial1 == 0U &&
isc_serial_gt(xhdr->serial0, xhdr->count)) isc_serial_gt(xhdr->serial0, xhdr->count))
{ {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_DEBUG(3), isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_DEBUG(3),
"%s: XHDR_VERSION2 count zero at %u", j->filename, "%s: XHDR_VERSION2 count zero at %u", j->filename,
serial); serial);
xhdr->serial1 = xhdr->serial0; xhdr->serial1 = xhdr->serial0;
@ -976,7 +977,8 @@ journal_next(dns_journal_t *j, journal_pos_t *pos) {
if (xhdr.serial0 != pos->serial || if (xhdr.serial0 != pos->serial ||
isc_serial_le(xhdr.serial1, xhdr.serial0)) isc_serial_le(xhdr.serial1, xhdr.serial0))
{ {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_ERROR,
"%s: journal file corrupt: " "%s: journal file corrupt: "
"expected serial %u, got %u", "expected serial %u, got %u",
j->filename, pos->serial, xhdr.serial0); j->filename, pos->serial, xhdr.serial0);
@ -991,8 +993,9 @@ journal_next(dns_journal_t *j, journal_pos_t *pos) {
: sizeof(journal_rawxhdr_ver1_t); : sizeof(journal_rawxhdr_ver1_t);
if ((off_t)(pos->offset + hdrsize + xhdr.size) < pos->offset) { if ((off_t)(pos->offset + hdrsize + xhdr.size) < pos->offset) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
"%s: offset too large", j->filename); ISC_LOG_ERROR, "%s: offset too large",
j->filename);
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
@ -1198,7 +1201,8 @@ dns_journal_writediff(dns_journal_t *j, dns_diff_t *diff) {
REQUIRE(DNS_DIFF_VALID(diff)); REQUIRE(DNS_DIFF_VALID(diff));
REQUIRE(j->state == JOURNAL_STATE_TRANSACTION); REQUIRE(j->state == JOURNAL_STATE_TRANSACTION);
isc_log_write(JOURNAL_DEBUG_LOGARGS(3), "writing to journal"); isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_DEBUG(3), "writing to journal");
(void)dns_diff_print(diff, NULL); (void)dns_diff_print(diff, NULL);
/* /*
@ -1222,7 +1226,8 @@ dns_journal_writediff(dns_journal_t *j, dns_diff_t *diff) {
} }
if (size >= DNS_JOURNAL_SIZE_MAX) { if (size >= DNS_JOURNAL_SIZE_MAX) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_ERROR,
"dns_journal_writediff: %s: journal entry " "dns_journal_writediff: %s: journal entry "
"too big to be stored: %" PRIu64 " bytes", "too big to be stored: %" PRIu64 " bytes",
j->filename, size); j->filename, size);
@ -1306,13 +1311,15 @@ dns_journal_commit(dns_journal_t *j) {
* Perform some basic consistency checks. * Perform some basic consistency checks.
*/ */
if (j->x.n_soa != 2) { if (j->x.n_soa != 2) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_ERROR,
"%s: malformed transaction: %d SOAs", j->filename, "%s: malformed transaction: %d SOAs", j->filename,
j->x.n_soa); j->x.n_soa);
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
if (!DNS_SERIAL_GT(j->x.pos[1].serial, j->x.pos[0].serial)) { if (!DNS_SERIAL_GT(j->x.pos[1].serial, j->x.pos[0].serial)) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_ERROR,
"%s: malformed transaction: serial number " "%s: malformed transaction: serial number "
"did not increase", "did not increase",
j->filename); j->filename);
@ -1320,7 +1327,8 @@ dns_journal_commit(dns_journal_t *j) {
} }
if (!JOURNAL_EMPTY(&j->header)) { if (!JOURNAL_EMPTY(&j->header)) {
if (j->x.pos[0].serial != j->header.end.serial) { if (j->x.pos[0].serial != j->header.end.serial) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_JOURNAL, ISC_LOG_ERROR,
"malformed transaction: " "malformed transaction: "
"%s last serial %u != " "%s last serial %u != "
"transaction first serial %u", "transaction first serial %u",
@ -1335,7 +1343,8 @@ dns_journal_commit(dns_journal_t *j) {
*/ */
total = j->x.pos[1].offset - j->x.pos[0].offset; total = j->x.pos[1].offset - j->x.pos[0].offset;
if (total >= DNS_JOURNAL_SIZE_MAX) { if (total >= DNS_JOURNAL_SIZE_MAX) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_ERROR,
"transaction too big to be stored in journal: " "transaction too big to be stored in journal: "
"%" PRIu64 "b (max is %" PRIu64 "b)", "%" PRIu64 "b (max is %" PRIu64 "b)",
total, (uint64_t)DNS_JOURNAL_SIZE_MAX); total, (uint64_t)DNS_JOURNAL_SIZE_MAX);
@ -1561,7 +1570,8 @@ dns_journal_rollforward(dns_journal_t *j, dns_db_t *db, unsigned int options) {
n_soa = 1; n_soa = 1;
} }
if (n_soa == 0) { if (n_soa == 0) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_JOURNAL, ISC_LOG_ERROR,
"%s: journal file corrupt: missing " "%s: journal file corrupt: missing "
"initial SOA", "initial SOA",
j->filename); j->filename);
@ -1578,7 +1588,8 @@ dns_journal_rollforward(dns_journal_t *j, dns_db_t *db, unsigned int options) {
dns_diff_append(&diff, &tuple); dns_diff_append(&diff, &tuple);
if (++n_put > 100) { if (++n_put > 100) {
isc_log_write(JOURNAL_DEBUG_LOGARGS(3), isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_JOURNAL, ISC_LOG_DEBUG(3),
"%s: applying diff to database (%u)", "%s: applying diff to database (%u)",
j->filename, db_serial); j->filename, db_serial);
(void)dns_diff_print(&diff, NULL); (void)dns_diff_print(&diff, NULL);
@ -1593,7 +1604,8 @@ dns_journal_rollforward(dns_journal_t *j, dns_db_t *db, unsigned int options) {
CHECK(result); CHECK(result);
if (n_put != 0) { if (n_put != 0) {
isc_log_write(JOURNAL_DEBUG_LOGARGS(3), isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_DEBUG(3),
"%s: applying final diff to database (%u)", "%s: applying final diff to database (%u)",
j->filename, db_serial); j->filename, db_serial);
(void)dns_diff_print(&diff, NULL); (void)dns_diff_print(&diff, NULL);
@ -1639,11 +1651,12 @@ dns_journal_print(isc_mem_t *mctx, uint32_t flags, const char *filename,
result = dns_journal_open(mctx, filename, DNS_JOURNAL_READ, &j); result = dns_journal_open(mctx, filename, DNS_JOURNAL_READ, &j);
if (result == ISC_R_NOTFOUND) { if (result == ISC_R_NOTFOUND) {
isc_log_write(JOURNAL_DEBUG_LOGARGS(3), "no journal file"); isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_DEBUG(3), "no journal file");
return (DNS_R_NOJOURNAL); return (DNS_R_NOJOURNAL);
} else if (result != ISC_R_SUCCESS) { } else if (result != ISC_R_SUCCESS) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
"journal open failure: %s: %s", ISC_LOG_ERROR, "journal open failure: %s: %s",
isc_result_totext(result), filename); isc_result_totext(result), filename);
return (result); return (result);
} }
@ -1703,7 +1716,8 @@ dns_journal_print(isc_mem_t *mctx, uint32_t flags, const char *filename,
} }
} }
if (n_soa == 0) { if (n_soa == 0) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_JOURNAL, ISC_LOG_ERROR,
"%s: journal file corrupt: missing " "%s: journal file corrupt: missing "
"initial SOA", "initial SOA",
j->filename); j->filename);
@ -1752,8 +1766,9 @@ dns_journal_print(isc_mem_t *mctx, uint32_t flags, const char *filename,
goto cleanup; goto cleanup;
failure: failure:
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
"%s: cannot print: journal file corrupt", j->filename); ISC_LOG_ERROR, "%s: cannot print: journal file corrupt",
j->filename);
cleanup: cleanup:
if (source.base != NULL) { if (source.base != NULL) {
@ -1957,7 +1972,8 @@ read_one_rr(dns_journal_t *j) {
dns_journal_t save = *j; dns_journal_t save = *j;
if (j->offset > j->it.epos.offset) { if (j->offset > j->it.epos.offset) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_ERROR,
"%s: journal corrupt: possible integer overflow", "%s: journal corrupt: possible integer overflow",
j->filename); j->filename);
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
@ -1972,7 +1988,8 @@ read_one_rr(dns_journal_t *j) {
*/ */
CHECK(journal_read_xhdr(j, &xhdr)); CHECK(journal_read_xhdr(j, &xhdr));
if (xhdr.size == 0) { if (xhdr.size == 0) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_JOURNAL, ISC_LOG_ERROR,
"%s: journal corrupt: empty transaction", "%s: journal corrupt: empty transaction",
j->filename); j->filename);
FAIL(ISC_R_UNEXPECTED); FAIL(ISC_R_UNEXPECTED);
@ -1986,7 +2003,8 @@ read_one_rr(dns_journal_t *j) {
if (xhdr.serial0 != j->it.current_serial || if (xhdr.serial0 != j->it.current_serial ||
isc_serial_le(xhdr.serial1, xhdr.serial0)) isc_serial_le(xhdr.serial1, xhdr.serial0))
{ {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_JOURNAL, ISC_LOG_ERROR,
"%s: journal file corrupt: " "%s: journal file corrupt: "
"expected serial %u, got %u", "expected serial %u, got %u",
j->filename, j->it.current_serial, j->filename, j->it.current_serial,
@ -2009,7 +2027,8 @@ read_one_rr(dns_journal_t *j) {
* size owner name, well below 70 k total. * size owner name, well below 70 k total.
*/ */
if (rrhdr.size < 1 + 10 || rrhdr.size > 70000) { if (rrhdr.size < 1 + 10 || rrhdr.size > 70000) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_ERROR,
"%s: journal corrupt: impossible RR size " "%s: journal corrupt: impossible RR size "
"(%d bytes)", "(%d bytes)",
j->filename, rrhdr.size); j->filename, rrhdr.size);
@ -2051,7 +2070,8 @@ read_one_rr(dns_journal_t *j) {
rdlen = isc_buffer_getuint16(&j->it.source); rdlen = isc_buffer_getuint16(&j->it.source);
if (rdlen > DNS_RDATA_MAXLENGTH) { if (rdlen > DNS_RDATA_MAXLENGTH) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_JOURNAL,
ISC_LOG_ERROR,
"%s: journal corrupt: impossible rdlen " "%s: journal corrupt: impossible rdlen "
"(%u bytes)", "(%u bytes)",
j->filename, rdlen); j->filename, rdlen);
@ -2400,7 +2420,9 @@ dns_db_diffx(dns_diff_t *diff, dns_db_t *dba, dns_dbversion_t *dbvera,
if (journal != NULL) { if (journal != NULL) {
if (ISC_LIST_EMPTY(diff->tuples)) { if (ISC_LIST_EMPTY(diff->tuples)) {
isc_log_write(JOURNAL_DEBUG_LOGARGS(3), "no changes"); isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_JOURNAL, ISC_LOG_DEBUG(3),
"no changes");
} else { } else {
CHECK(dns_journal_write_transaction(journal, diff)); CHECK(dns_journal_write_transaction(journal, diff));
} }
@ -2629,7 +2651,8 @@ dns_journal_compact(isc_mem_t *mctx, char *filename, uint32_t serial,
size = xhdr.size; size = xhdr.size;
if (size > len) { if (size > len) {
isc_log_write(JOURNAL_COMMON_LOGARGS, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_JOURNAL,
ISC_LOG_ERROR, ISC_LOG_ERROR,
"%s: journal file corrupt, " "%s: journal file corrupt, "
"transaction too large", "transaction too large",
@ -2663,7 +2686,8 @@ dns_journal_compact(isc_mem_t *mctx, char *filename, uint32_t serial,
size = xhdr.size; size = xhdr.size;
if (size > len) { if (size > len) {
isc_log_write( isc_log_write(
JOURNAL_COMMON_LOGARGS, DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_JOURNAL,
ISC_LOG_ERROR, ISC_LOG_ERROR,
"%s: journal file corrupt, " "%s: journal file corrupt, "
"transaction too large", "transaction too large",

View File

@ -53,10 +53,10 @@
dst_key_setstate((key), (state), (target)); \ dst_key_setstate((key), (state), (target)); \
dst_key_settime((key), (timing), time); \ dst_key_settime((key), (timing), time); \
\ \
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(1))) { \ if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) { \
dst_key_format((key), keystr, sizeof(keystr)); \ dst_key_format((key), keystr, sizeof(keystr)); \
isc_log_write( \ isc_log_write( \
dns_lctx, DNS_LOGCATEGORY_DNSSEC, \ DNS_LOGCATEGORY_DNSSEC, \
DNS_LOGMODULE_DNSSEC, \ DNS_LOGMODULE_DNSSEC, \
ISC_LOG_DEBUG(3), \ ISC_LOG_DEBUG(3), \
"keymgr: DNSKEY %s (%s) initialize " \ "keymgr: DNSKEY %s (%s) initialize " \
@ -90,10 +90,9 @@ static void
log_key_overflow(dst_key_t *key, const char *what) { log_key_overflow(dst_key_t *key, const char *what) {
char keystr[DST_KEY_FORMATSIZE]; char keystr[DST_KEY_FORMATSIZE];
dst_key_format(key, keystr, sizeof(keystr)); dst_key_format(key, keystr, sizeof(keystr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC, isc_log_write(
ISC_LOG_WARNING, DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING,
"keymgr: DNSKEY %s (%s) calculation overflowed", keystr, "keymgr: DNSKEY %s (%s) calculation overflowed", keystr, what);
what);
} }
/* /*
@ -382,7 +381,7 @@ keymgr_key_retire(dns_dnsseckey_t *key, dns_kasp_t *kasp, isc_stdtime_t now) {
} }
dst_key_format(key->key, keystr, sizeof(keystr)); dst_key_format(key->key, keystr, sizeof(keystr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
ISC_LOG_INFO, "keymgr: retire DNSKEY %s (%s)", keystr, ISC_LOG_INFO, "keymgr: retire DNSKEY %s (%s)", keystr,
keymgr_keyrole(key->key)); keymgr_keyrole(key->key));
} }
@ -491,7 +490,7 @@ keymgr_createkey(dns_kasp_key_t *kkey, const dns_name_t *origin,
} }
if (conflict) { if (conflict) {
/* Try again. */ /* Try again. */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING, DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING,
"keymgr: key collision id %d", "keymgr: key collision id %d",
dst_key_id(newkey)); dst_key_id(newkey));
@ -1216,7 +1215,7 @@ keymgr_transition_allowed(dns_dnsseckeylist_t *keyring, dns_dnsseckey_t *key,
int type, dst_key_state_t next_state, int type, dst_key_state_t next_state,
bool secure_to_insecure) { bool secure_to_insecure) {
/* Debug logging. */ /* Debug logging. */
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(1))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
bool rule1a, rule1b, rule2a, rule2b, rule3a, rule3b; bool rule1a, rule1b, rule2a, rule2b, rule3a, rule3b;
char keystr[DST_KEY_FORMATSIZE]; char keystr[DST_KEY_FORMATSIZE];
dst_key_format(key->key, keystr, sizeof(keystr)); dst_key_format(key->key, keystr, sizeof(keystr));
@ -1229,7 +1228,7 @@ keymgr_transition_allowed(dns_dnsseckeylist_t *keyring, dns_dnsseckey_t *key,
rule3a = keymgr_have_rrsig(keyring, key, type, NA); rule3a = keymgr_have_rrsig(keyring, key, type, NA);
rule3b = keymgr_have_rrsig(keyring, key, type, next_state); rule3b = keymgr_have_rrsig(keyring, key, type, next_state);
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC, DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1),
"keymgr: dnssec evaluation of %s %s record %s: " "keymgr: dnssec evaluation of %s %s record %s: "
"rule1=(~%s or %s) rule2=(~%s or %s) " "rule1=(~%s or %s) rule2=(~%s or %s) "
@ -1470,7 +1469,7 @@ transition:
continue; continue;
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1),
"keymgr: examine %s %s type %s " "keymgr: examine %s %s type %s "
"in state %s", "in state %s",
@ -1485,7 +1484,7 @@ transition:
* No change needed, continue with the next * No change needed, continue with the next
* record type. * record type.
*/ */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, DNS_LOGMODULE_DNSSEC,
ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1),
"keymgr: %s %s type %s in " "keymgr: %s %s type %s in "
@ -1496,7 +1495,7 @@ transition:
continue; continue;
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1),
"keymgr: can we transition %s %s type %s " "keymgr: can we transition %s %s type %s "
"state %s to state %s?", "state %s to state %s?",
@ -1510,7 +1509,7 @@ transition:
{ {
/* No, please respect rollover methods. */ /* No, please respect rollover methods. */
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1),
"keymgr: policy says no to %s %s type " "keymgr: policy says no to %s %s type "
"%s " "%s "
@ -1529,7 +1528,7 @@ transition:
{ {
/* No, this would make the zone bogus. */ /* No, this would make the zone bogus. */
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1),
"keymgr: dnssec says no to %s %s type " "keymgr: dnssec says no to %s %s type "
"%s " "%s "
@ -1547,7 +1546,7 @@ transition:
if (when > now) { if (when > now) {
/* Not yet. */ /* Not yet. */
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1),
"keymgr: time says no to %s %s type %s " "keymgr: time says no to %s %s type %s "
"state %s to state %s (wait %u " "state %s to state %s (wait %u "
@ -1562,7 +1561,7 @@ transition:
continue; continue;
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1),
"keymgr: transition %s %s type %s " "keymgr: transition %s %s type %s "
"state %s to state %s!", "state %s to state %s!",
@ -1716,11 +1715,11 @@ keymgr_key_rollover(dns_kasp_key_t *kaspkey, dns_dnsseckey_t *active_key,
/* Do we need to create a successor for the active key? */ /* Do we need to create a successor for the active key? */
if (active_key != NULL) { if (active_key != NULL) {
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(1))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
dst_key_format(active_key->key, keystr, sizeof(keystr)); dst_key_format(active_key->key, keystr, sizeof(keystr));
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1),
"keymgr: DNSKEY %s (%s) is active in policy %s", "keymgr: DNSKEY %s (%s) is active in policy %s",
keystr, keymgr_keyrole(active_key->key), keystr, keymgr_keyrole(active_key->key),
dns_kasp_getname(kasp)); dns_kasp_getname(kasp));
@ -1733,11 +1732,11 @@ keymgr_key_rollover(dns_kasp_key_t *kaspkey, dns_dnsseckey_t *active_key,
prepub = keymgr_prepublication_time(active_key, kasp, lifetime, prepub = keymgr_prepublication_time(active_key, kasp, lifetime,
now); now);
if (prepub > now) { if (prepub > now) {
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(1))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
dst_key_format(active_key->key, keystr, dst_key_format(active_key->key, keystr,
sizeof(keystr)); sizeof(keystr));
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1),
"keymgr: new successor needed for " "keymgr: new successor needed for "
"DNSKEY %s (%s) (policy %s) in %u " "DNSKEY %s (%s) (policy %s) in %u "
@ -1756,11 +1755,11 @@ keymgr_key_rollover(dns_kasp_key_t *kaspkey, dns_dnsseckey_t *active_key,
if (keymgr_key_has_successor(active_key, keyring)) { if (keymgr_key_has_successor(active_key, keyring)) {
/* Key already has successor. */ /* Key already has successor. */
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(1))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
dst_key_format(active_key->key, keystr, dst_key_format(active_key->key, keystr,
sizeof(keystr)); sizeof(keystr));
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1),
"keymgr: key DNSKEY %s (%s) (policy " "keymgr: key DNSKEY %s (%s) (policy "
"%s) already has successor", "%s) already has successor",
@ -1770,9 +1769,9 @@ keymgr_key_rollover(dns_kasp_key_t *kaspkey, dns_dnsseckey_t *active_key,
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(1))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
dst_key_format(active_key->key, keystr, sizeof(keystr)); dst_key_format(active_key->key, keystr, sizeof(keystr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1),
"keymgr: need successor for DNSKEY %s " "keymgr: need successor for DNSKEY %s "
"(%s) (policy %s)", "(%s) (policy %s)",
@ -1785,7 +1784,7 @@ keymgr_key_rollover(dns_kasp_key_t *kaspkey, dns_dnsseckey_t *active_key,
*/ */
if (!rollover) { if (!rollover) {
dst_key_format(active_key->key, keystr, sizeof(keystr)); dst_key_format(active_key->key, keystr, sizeof(keystr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING, DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING,
"keymgr: DNSKEY %s (%s) is offline in " "keymgr: DNSKEY %s (%s) is offline in "
"policy %s, cannot start rollover", "policy %s, cannot start rollover",
@ -1793,11 +1792,11 @@ keymgr_key_rollover(dns_kasp_key_t *kaspkey, dns_dnsseckey_t *active_key,
dns_kasp_getname(kasp)); dns_kasp_getname(kasp));
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
} else if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(1))) { } else if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
char namestr[DNS_NAME_FORMATSIZE]; char namestr[DNS_NAME_FORMATSIZE];
dns_name_format(origin, namestr, sizeof(namestr)); dns_name_format(origin, namestr, sizeof(namestr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1),
"keymgr: no active key found for %s (policy %s)", "keymgr: no active key found for %s (policy %s)",
namestr, dns_kasp_getname(kasp)); namestr, dns_kasp_getname(kasp));
} }
@ -1912,7 +1911,7 @@ keymgr_key_rollover(dns_kasp_key_t *kaspkey, dns_dnsseckey_t *active_key,
/* Logging. */ /* Logging. */
dst_key_format(new_key->key, keystr, sizeof(keystr)); dst_key_format(new_key->key, keystr, sizeof(keystr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
ISC_LOG_INFO, "keymgr: DNSKEY %s (%s) %s for policy %s", ISC_LOG_INFO, "keymgr: DNSKEY %s (%s) %s for policy %s",
keystr, keymgr_keyrole(new_key->key), keystr, keymgr_keyrole(new_key->key),
(candidate != NULL) ? "selected" : "created", (candidate != NULL) ? "selected" : "created",
@ -1988,8 +1987,8 @@ keymgr_purge_keyfile(dst_key_t *key, int type) {
if (ret != ISC_R_SUCCESS) { if (ret != ISC_R_SUCCESS) {
char keystr[DST_KEY_FORMATSIZE]; char keystr[DST_KEY_FORMATSIZE];
dst_key_format(key, keystr, sizeof(keystr)); dst_key_format(key, keystr, sizeof(keystr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING, ISC_LOG_WARNING,
"keymgr: failed to purge DNSKEY %s (%s): cannot " "keymgr: failed to purge DNSKEY %s (%s): cannot "
"build filename (%s)", "build filename (%s)",
keystr, keymgr_keyrole(key), keystr, keymgr_keyrole(key),
@ -2000,8 +1999,8 @@ keymgr_purge_keyfile(dst_key_t *key, int type) {
if (unlink(filename) < 0) { if (unlink(filename) < 0) {
char keystr[DST_KEY_FORMATSIZE]; char keystr[DST_KEY_FORMATSIZE];
dst_key_format(key, keystr, sizeof(keystr)); dst_key_format(key, keystr, sizeof(keystr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING, ISC_LOG_WARNING,
"keymgr: failed to purge DNSKEY %s (%s): unlink " "keymgr: failed to purge DNSKEY %s (%s): unlink "
"'%s' failed", "'%s' failed",
keystr, keymgr_keyrole(key), filename); keystr, keymgr_keyrole(key), filename);
@ -2036,11 +2035,11 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
*nexttime = 0; *nexttime = 0;
/* Debug logging: what keys are available in the keyring? */ /* Debug logging: what keys are available in the keyring? */
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(1))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
if (ISC_LIST_EMPTY(*keyring)) { if (ISC_LIST_EMPTY(*keyring)) {
char namebuf[DNS_NAME_FORMATSIZE]; char namebuf[DNS_NAME_FORMATSIZE];
dns_name_format(origin, namebuf, sizeof(namebuf)); dns_name_format(origin, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1),
"keymgr: keyring empty (zone %s policy " "keymgr: keyring empty (zone %s policy "
"%s)", "%s)",
@ -2051,7 +2050,7 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
dkey != NULL; dkey = ISC_LIST_NEXT(dkey, link)) dkey != NULL; dkey = ISC_LIST_NEXT(dkey, link))
{ {
dst_key_format(dkey->key, keystr, sizeof(keystr)); dst_key_format(dkey->key, keystr, sizeof(keystr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1),
"keymgr: keyring: %s (policy %s)", keystr, "keymgr: keyring: %s (policy %s)", keystr,
dns_kasp_getname(kasp)); dns_kasp_getname(kasp));
@ -2060,7 +2059,7 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
dkey != NULL; dkey = ISC_LIST_NEXT(dkey, link)) dkey != NULL; dkey = ISC_LIST_NEXT(dkey, link))
{ {
dst_key_format(dkey->key, keystr, sizeof(keystr)); dst_key_format(dkey->key, keystr, sizeof(keystr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(1),
"keymgr: dnskeys: %s (policy %s)", keystr, "keymgr: dnskeys: %s (policy %s)", keystr,
dns_kasp_getname(kasp)); dns_kasp_getname(kasp));
@ -2100,7 +2099,7 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
dns_kasp_purgekeys(kasp), now)) dns_kasp_purgekeys(kasp), now))
{ {
dst_key_format(dkey->key, keystr, sizeof(keystr)); dst_key_format(dkey->key, keystr, sizeof(keystr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO, DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
"keymgr: purge DNSKEY %s (%s) according " "keymgr: purge DNSKEY %s (%s) according "
"to policy %s", "to policy %s",
@ -2130,7 +2129,7 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
/* Found a match. */ /* Found a match. */
dst_key_format(dkey->key, keystr, dst_key_format(dkey->key, keystr,
sizeof(keystr)); sizeof(keystr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, DNS_LOGMODULE_DNSSEC,
ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1),
"keymgr: DNSKEY %s (%s) matches " "keymgr: DNSKEY %s (%s) matches "
@ -2193,7 +2192,6 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
dst_key_format(dnskey->key, keystr, dst_key_format(dnskey->key, keystr,
sizeof(keystr)); sizeof(keystr));
isc_log_write( isc_log_write(
dns_lctx,
DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, DNS_LOGMODULE_DNSSEC,
ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1),
@ -2249,11 +2247,11 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
RETERR(dst_key_tofile(dkey->key, options, directory)); RETERR(dst_key_tofile(dkey->key, options, directory));
dst_key_setmodified(dkey->key, false); dst_key_setmodified(dkey->key, false);
if (!isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) { if (!isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
continue; continue;
} }
dst_key_format(dkey->key, keystr, sizeof(keystr)); dst_key_format(dkey->key, keystr, sizeof(keystr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(3), DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(3),
"keymgr: DNSKEY %s (%s) " "keymgr: DNSKEY %s (%s) "
"saved to directory %s, policy %s", "saved to directory %s, policy %s",
@ -2275,12 +2273,11 @@ failure:
} }
} }
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
char namebuf[DNS_NAME_FORMATSIZE]; char namebuf[DNS_NAME_FORMATSIZE];
dns_name_format(origin, namebuf, sizeof(namebuf)); dns_name_format(origin, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3), "keymgr: %s done", namebuf);
"keymgr: %s done", namebuf);
} }
return (result); return (result);
} }
@ -2343,14 +2340,14 @@ keymgr_checkds(dns_kasp_t *kasp, dns_dnsseckeylist_t *keyring,
} }
} }
if (isc_log_wouldlog(dns_lctx, ISC_LOG_NOTICE)) { if (isc_log_wouldlog(ISC_LOG_NOTICE)) {
char keystr[DST_KEY_FORMATSIZE]; char keystr[DST_KEY_FORMATSIZE];
char timestr[26]; /* Minimal buf as per ctime_r() spec. */ char timestr[26]; /* Minimal buf as per ctime_r() spec. */
dst_key_format(ksk_key->key, keystr, sizeof(keystr)); dst_key_format(ksk_key->key, keystr, sizeof(keystr));
isc_stdtime_tostring(when, timestr, sizeof(timestr)); isc_stdtime_tostring(when, timestr, sizeof(timestr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"keymgr: checkds DS for key %s seen %s at %s", "keymgr: checkds DS for key %s seen %s at %s",
keystr, dspublish ? "published" : "withdrawn", keystr, dspublish ? "published" : "withdrawn",
timestr); timestr);

View File

@ -217,8 +217,8 @@ dns_keystore_keygen(dns_keystore_t *keystore, const dns_name_t *origin,
char namebuf[DNS_NAME_FORMATSIZE]; char namebuf[DNS_NAME_FORMATSIZE];
dns_name_format(origin, namebuf, sizeof(namebuf)); dns_name_format(origin, namebuf, sizeof(namebuf));
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_ERROR, ISC_LOG_ERROR,
"keystore: failed to create PKCS#11 object " "keystore: failed to create PKCS#11 object "
"for zone %s, policy %s: %s", "for zone %s, policy %s: %s",
namebuf, policy, isc_result_totext(result)); namebuf, policy, isc_result_totext(result));
@ -232,15 +232,15 @@ dns_keystore_keygen(dns_keystore_t *keystore, const dns_name_t *origin,
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_ERROR, ISC_LOG_ERROR,
"keystore: failed to generate PKCS#11 object " "keystore: failed to generate PKCS#11 object "
"%s: %s", "%s: %s",
label, isc_result_totext(result)); label, isc_result_totext(result));
return (result); return (result);
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_DNSSEC,
DNS_LOGMODULE_DNSSEC, ISC_LOG_ERROR, ISC_LOG_ERROR,
"keystore: generated PKCS#11 object %s", label); "keystore: generated PKCS#11 object %s", label);
} else { } else {
result = dst_key_generate(origin, alg, size, 0, flags, result = dst_key_generate(origin, alg, size, 0, flags,

View File

@ -53,10 +53,8 @@ isc_logmodule_t dns_modules[] = {
{ "dns/qp", 0 }, { NULL, 0 }, { "dns/qp", 0 }, { NULL, 0 },
}; };
isc_log_t *dns_lctx = NULL;
void void
dns_log_init(isc_log_t *lctx) { dns_log_init(void) {
isc_log_registercategories(lctx, dns_categories); isc_log_registercategories(dns_categories);
isc_log_registermodules(lctx, dns_modules); isc_log_registermodules(dns_modules);
} }

View File

@ -1448,12 +1448,12 @@ flushandsync(FILE *f, isc_result_t result, const char *temp) {
} }
if (result != ISC_R_SUCCESS && logit) { if (result != ISC_R_SUCCESS && logit) {
if (temp != NULL) { if (temp != NULL) {
isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR, DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR,
"dumping to master file: %s: flush: %s", "dumping to master file: %s: flush: %s",
temp, isc_result_totext(result)); temp, isc_result_totext(result));
} else { } else {
isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR, DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR,
"dumping to stream: flush: %s", "dumping to stream: flush: %s",
isc_result_totext(result)); isc_result_totext(result));
@ -1466,12 +1466,12 @@ flushandsync(FILE *f, isc_result_t result, const char *temp) {
} }
if (result != ISC_R_SUCCESS && logit) { if (result != ISC_R_SUCCESS && logit) {
if (temp != NULL) { if (temp != NULL) {
isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR, DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR,
"dumping to master file: %s: fsync: %s", "dumping to master file: %s: fsync: %s",
temp, isc_result_totext(result)); temp, isc_result_totext(result));
} else { } else {
isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR, DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR,
"dumping to stream: fsync: %s", "dumping to stream: fsync: %s",
isc_result_totext(result)); isc_result_totext(result));
@ -1496,8 +1496,8 @@ closeandrename(FILE *f, isc_result_t result, const char *temp,
result = tresult; result = tresult;
} }
if (result != ISC_R_SUCCESS && logit) { if (result != ISC_R_SUCCESS && logit) {
isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTERDUMP,
DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR, ISC_LOG_ERROR,
"dumping master file: %s: fclose: %s", temp, "dumping master file: %s: fclose: %s", temp,
isc_result_totext(result)); isc_result_totext(result));
logit = false; logit = false;
@ -1508,8 +1508,8 @@ closeandrename(FILE *f, isc_result_t result, const char *temp,
(void)isc_file_remove(temp); (void)isc_file_remove(temp);
} }
if (result != ISC_R_SUCCESS && logit) { if (result != ISC_R_SUCCESS && logit) {
isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTERDUMP,
DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR, ISC_LOG_ERROR,
"dumping master file: rename: %s: %s", file, "dumping master file: rename: %s: %s", file,
isc_result_totext(result)); isc_result_totext(result));
} }
@ -1852,8 +1852,8 @@ opentmp(isc_mem_t *mctx, const char *file, char **tempp, FILE **fp) {
result = isc_file_openunique(tempname, &f); result = isc_file_openunique(tempname, &f);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTERDUMP,
DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR, ISC_LOG_ERROR,
"dumping master file: %s: open: %s", tempname, "dumping master file: %s: open: %s", tempname,
isc_result_totext(result)); isc_result_totext(result));
goto cleanup; goto cleanup;

View File

@ -1843,8 +1843,8 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source,
isc_buffer_remainingregion(source, &r); isc_buffer_remainingregion(source, &r);
if (r.length != 0) { if (r.length != 0) {
isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MESSAGE,
DNS_LOGMODULE_MESSAGE, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3),
"message has %u byte(s) of trailing garbage", "message has %u byte(s) of trailing garbage",
r.length); r.length);
} }
@ -4695,7 +4695,7 @@ logfmtpacket(dns_message_t *message, const char *description,
int len = 1024; int len = 1024;
isc_result_t result; isc_result_t result;
if (!isc_log_wouldlog(dns_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
@ -4718,9 +4718,8 @@ logfmtpacket(dns_message_t *message, const char *description,
isc_mem_put(mctx, buf, len); isc_mem_put(mctx, buf, len);
len += 1024; len += 1024;
} else if (result == ISC_R_SUCCESS) { } else if (result == ISC_R_SUCCESS) {
isc_log_write(dns_lctx, category, module, level, isc_log_write(category, module, level, "%s%s%s%s%.*s",
"%s%s%s%s%.*s", description, space, description, space, addrbuf, newline,
addrbuf, newline,
(int)isc_buffer_usedlength(&buffer), buf); (int)isc_buffer_usedlength(&buffer), buf);
} }
} while (result == ISC_R_NOSPACE); } while (result == ISC_R_NOSPACE);

View File

@ -385,9 +385,8 @@ delete_expired(void *arg) {
{ {
char nb[DNS_NAME_FORMATSIZE]; char nb[DNS_NAME_FORMATSIZE];
dns_name_format(&nta->name, nb, sizeof(nb)); dns_name_format(&nta->name, nb, sizeof(nb));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_NTA,
DNS_LOGMODULE_NTA, ISC_LOG_INFO, ISC_LOG_INFO, "deleting expired NTA at %s", nb);
"deleting expired NTA at %s", nb);
dns_qp_deletename(qp, &nta->name, NULL, NULL); dns_qp_deletename(qp, &nta->name, NULL, NULL);
dns__nta_shutdown(nta); dns__nta_shutdown(nta);
dns__nta_unref(nta); dns__nta_unref(nta);
@ -584,12 +583,12 @@ dns__nta_shutdown_cb(void *arg) {
REQUIRE(VALID_NTA(nta)); REQUIRE(VALID_NTA(nta));
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
char nb[DNS_NAME_FORMATSIZE]; char nb[DNS_NAME_FORMATSIZE];
dns_name_format(&nta->name, nb, sizeof(nb)); dns_name_format(&nta->name, nb, sizeof(nb));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_NTA,
DNS_LOGMODULE_NTA, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3), "shutting down NTA %p at %s",
"shutting down NTA %p at %s", nta, nb); nta, nb);
} }
if (nta->timer) { if (nta->timer) {
isc_timer_stop(nta->timer); isc_timer_stop(nta->timer);

View File

@ -69,8 +69,8 @@ static atomic_uint_fast64_t rollback_time;
#define PRItime " %" PRIu64 " ns " #define PRItime " %" PRIu64 " ns "
#if DNS_QP_LOG_STATS #if DNS_QP_LOG_STATS
#define LOG_STATS(...) \ #define LOG_STATS(...) \
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_QP, \ isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_QP, \
ISC_LOG_DEBUG(1), __VA_ARGS__) ISC_LOG_DEBUG(1), __VA_ARGS__)
#else #else
#define LOG_STATS(...) #define LOG_STATS(...)
@ -83,8 +83,8 @@ static atomic_uint_fast64_t rollback_time;
*/ */
#define TRACE(fmt, ...) \ #define TRACE(fmt, ...) \
do { \ do { \
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(7))) { \ if (isc_log_wouldlog(ISC_LOG_DEBUG(7))) { \
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, \ isc_log_write(DNS_LOGCATEGORY_DATABASE, \
DNS_LOGMODULE_QP, ISC_LOG_DEBUG(7), \ DNS_LOGMODULE_QP, ISC_LOG_DEBUG(7), \
"%s:%d:%s(qp %p uctx \"%s\"):t%u: " fmt, \ "%s:%d:%s(qp %p uctx \"%s\"):t%u: " fmt, \
__FILE__, __LINE__, __func__, qp, \ __FILE__, __LINE__, __func__, qp, \
@ -998,7 +998,7 @@ squash_twigs(dns_qp_t *qp, dns_qpref_t twigs, dns_qpweight_t size) {
* letting compact+recycle fail repeatedly. * letting compact+recycle fail repeatedly.
*/ */
if (QP_AUTOGC(qp)) { if (QP_AUTOGC(qp)) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_QP, ISC_LOG_NOTICE, DNS_LOGMODULE_QP, ISC_LOG_NOTICE,
"qp %p uctx \"%s\" compact/recycle " "qp %p uctx \"%s\" compact/recycle "
"failed to recover any space, " "failed to recover any space, "

View File

@ -571,11 +571,11 @@ static void
delete_node(qpcache_t *qpdb, qpcnode_t *node) { delete_node(qpcache_t *qpdb, qpcnode_t *node) {
isc_result_t result = ISC_R_UNEXPECTED; isc_result_t result = ISC_R_UNEXPECTED;
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(1))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
char printname[DNS_NAME_FORMATSIZE]; char printname[DNS_NAME_FORMATSIZE];
dns_name_format(&node->name, printname, sizeof(printname)); dns_name_format(&node->name, printname, sizeof(printname));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE,
DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1),
"delete_node(): %p %s (bucket %d)", node, "delete_node(): %p %s (bucket %d)", node,
printname, node->locknum); printname, node->locknum);
} }
@ -588,7 +588,7 @@ delete_node(qpcache_t *qpdb, qpcnode_t *node) {
*/ */
result = dns_qp_deletename(qpdb->nsec, &node->name, NULL, NULL); result = dns_qp_deletename(qpdb->nsec, &node->name, NULL, NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_CACHE, ISC_LOG_WARNING, DNS_LOGMODULE_CACHE, ISC_LOG_WARNING,
"delete_node(): " "delete_node(): "
"dns_qp_deletename: %s", "dns_qp_deletename: %s",
@ -603,8 +603,8 @@ delete_node(qpcache_t *qpdb, qpcnode_t *node) {
break; break;
} }
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE,
DNS_LOGMODULE_CACHE, ISC_LOG_WARNING, ISC_LOG_WARNING,
"delete_node(): " "delete_node(): "
"dns_qp_deletename: %s", "dns_qp_deletename: %s",
isc_result_totext(result)); isc_result_totext(result));
@ -2487,9 +2487,8 @@ free_qpdb(qpcache_t *qpdb, bool log) {
} else { } else {
strlcpy(buf, "<UNKNOWN>", sizeof(buf)); strlcpy(buf, "<UNKNOWN>", sizeof(buf));
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE,
DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1), "done free_qpdb(%s)", buf);
"done free_qpdb(%s)", buf);
} }
if (dns_name_dynamic(&qpdb->common.origin)) { if (dns_name_dynamic(&qpdb->common.origin)) {
dns_name_free(&qpdb->common.origin, qpdb->common.mctx); dns_name_free(&qpdb->common.origin, qpdb->common.mctx);
@ -2595,7 +2594,7 @@ qpdb_destroy(dns_db_t *arg) {
} else { } else {
strlcpy(buf, "<UNKNOWN>", sizeof(buf)); strlcpy(buf, "<UNKNOWN>", sizeof(buf));
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1), DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1),
"calling free_qpdb(%s)", buf); "calling free_qpdb(%s)", buf);
free_qpdb(qpdb, true); free_qpdb(qpdb, true);
@ -2780,7 +2779,7 @@ detachnode(dns_db_t *db, dns_dbnode_t **targetp DNS__DB_FLARG) {
} else { } else {
strlcpy(buf, "<UNKNOWN>", sizeof(buf)); strlcpy(buf, "<UNKNOWN>", sizeof(buf));
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1), DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1),
"calling free_qpdb(%s)", buf); "calling free_qpdb(%s)", buf);
free_qpdb(qpdb, true); free_qpdb(qpdb, true);

View File

@ -456,9 +456,8 @@ free_qpdb(qpzonedb_t *qpdb, bool log) {
} else { } else {
strlcpy(buf, "<UNKNOWN>", sizeof(buf)); strlcpy(buf, "<UNKNOWN>", sizeof(buf));
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DB,
DNS_LOGMODULE_DB, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1), "called free_qpdb(%s)", buf);
"called free_qpdb(%s)", buf);
} }
call_rcu(&qpdb->rcu_head, free_db_rcu); call_rcu(&qpdb->rcu_head, free_db_rcu);
@ -518,7 +517,7 @@ qpdb_destroy(dns_db_t *arg) {
} else { } else {
strlcpy(buf, "<UNKNOWN>", sizeof(buf)); strlcpy(buf, "<UNKNOWN>", sizeof(buf));
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_DB, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DB, ISC_LOG_DEBUG(1),
"calling free_qpdb(%s)", buf); "calling free_qpdb(%s)", buf);
free_qpdb(qpdb, true); free_qpdb(qpdb, true);
@ -2960,7 +2959,7 @@ previous_closest_nsec(dns_rdatatype_t type, qpz_search_t *search,
* nodes in the auxiliary tree that are awaiting deletion. * nodes in the auxiliary tree that are awaiting deletion.
*/ */
if (result != DNS_R_PARTIALMATCH && result != ISC_R_NOTFOUND) { if (result != DNS_R_PARTIALMATCH && result != ISC_R_NOTFOUND) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_DB, ISC_LOG_ERROR, DNS_LOGMODULE_DB, ISC_LOG_ERROR,
"previous_closest_nsec(): %s", "previous_closest_nsec(): %s",
isc_result_totext(result)); isc_result_totext(result));
@ -3882,7 +3881,7 @@ detachnode(dns_db_t *db, dns_dbnode_t **targetp DNS__DB_FLARG) {
} else { } else {
strlcpy(buf, "<UNKNOWN>", sizeof(buf)); strlcpy(buf, "<UNKNOWN>", sizeof(buf));
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_DB, ISC_LOG_DEBUG(1), DNS_LOGMODULE_DB, ISC_LOG_DEBUG(1),
"calling free_qpdb(%s)", buf); "calling free_qpdb(%s)", buf);
free_qpdb(qpdb, true); free_qpdb(qpdb, true);

View File

@ -772,7 +772,7 @@ previous_closest_nsec(dns_rdatatype_t type, rbtdb_search_t *search,
* nodes in the auxiliary tree that are awaiting deletion. * nodes in the auxiliary tree that are awaiting deletion.
*/ */
if (result != DNS_R_PARTIALMATCH && result != ISC_R_NOTFOUND) { if (result != DNS_R_PARTIALMATCH && result != ISC_R_NOTFOUND) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_CACHE, ISC_LOG_ERROR, DNS_LOGMODULE_CACHE, ISC_LOG_ERROR,
"previous_closest_nsec(): %s", "previous_closest_nsec(): %s",
isc_result_totext(result)); isc_result_totext(result));
@ -1644,8 +1644,8 @@ loadnode(dns_rbtdb_t *rbtdb, const dns_name_t *name, dns_rbtnode_t **nodep,
if (nsecresult == ISC_R_EXISTS) { if (nsecresult == ISC_R_EXISTS) {
#if 1 /* 0 */ #if 1 /* 0 */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE,
DNS_LOGMODULE_CACHE, ISC_LOG_WARNING, ISC_LOG_WARNING,
"addnode: NSEC node already exists"); "addnode: NSEC node already exists");
#endif /* if 1 */ #endif /* if 1 */
node->nsec = DNS_DB_NSEC_HAS_NSEC; node->nsec = DNS_DB_NSEC_HAS_NSEC;
@ -1658,7 +1658,7 @@ loadnode(dns_rbtdb_t *rbtdb, const dns_name_t *name, dns_rbtnode_t **nodep,
*/ */
tmpresult = dns_rbt_deletenode(rbtdb->tree, node, false); tmpresult = dns_rbt_deletenode(rbtdb->tree, node, false);
if (tmpresult != ISC_R_SUCCESS) { if (tmpresult != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_CACHE, ISC_LOG_WARNING, DNS_LOGMODULE_CACHE, ISC_LOG_WARNING,
"loading_addrdataset: " "loading_addrdataset: "
"dns_rbt_deletenode: %s after " "dns_rbt_deletenode: %s after "

View File

@ -434,8 +434,8 @@ adjust_quantum(unsigned int old, isc_time_t *start) {
nodes = (nodes + old * 3) / 4; nodes = (nodes + old * 3) / 4;
if (nodes != old) { if (nodes != old) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE,
DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1),
"adjust_quantum: old=%d, new=%d", old, nodes); "adjust_quantum: old=%d, new=%d", old, nodes);
} }
@ -525,9 +525,8 @@ free_rbtdb(dns_rbtdb_t *rbtdb, bool log) {
} else { } else {
strlcpy(buf, "<UNKNOWN>", sizeof(buf)); strlcpy(buf, "<UNKNOWN>", sizeof(buf));
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE,
DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1), "done free_rbtdb(%s)", buf);
"done free_rbtdb(%s)", buf);
} }
if (dns_name_dynamic(&rbtdb->common.origin)) { if (dns_name_dynamic(&rbtdb->common.origin)) {
dns_name_free(&rbtdb->common.origin, rbtdb->common.mctx); dns_name_free(&rbtdb->common.origin, rbtdb->common.mctx);
@ -654,7 +653,7 @@ dns__rbtdb_destroy(dns_db_t *arg) {
} else { } else {
strlcpy(buf, "<UNKNOWN>", sizeof(buf)); strlcpy(buf, "<UNKNOWN>", sizeof(buf));
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1), DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1),
"calling free_rbtdb(%s)", buf); "calling free_rbtdb(%s)", buf);
free_rbtdb(rbtdb, true); free_rbtdb(rbtdb, true);
@ -1051,10 +1050,10 @@ delete_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) {
INSIST(!ISC_LINK_LINKED(node, deadlink)); INSIST(!ISC_LINK_LINKED(node, deadlink));
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(1))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
char printname[DNS_NAME_FORMATSIZE]; char printname[DNS_NAME_FORMATSIZE];
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE,
DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1),
"delete_node(): %p %s (bucket %d)", node, "delete_node(): %p %s (bucket %d)", node,
dns_rbt_formatnodename(node, printname, dns_rbt_formatnodename(node, printname,
sizeof(printname)), sizeof(printname)),
@ -1081,7 +1080,7 @@ delete_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) {
NULL, DNS_RBTFIND_EMPTYDATA, NULL, NULL, DNS_RBTFIND_EMPTYDATA, NULL,
NULL); NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_CACHE, ISC_LOG_WARNING, DNS_LOGMODULE_CACHE, ISC_LOG_WARNING,
"delete_node: " "delete_node: "
"dns_rbt_findnode(nsec): %s", "dns_rbt_findnode(nsec): %s",
@ -1091,7 +1090,7 @@ delete_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) {
false); false);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_CACHE, ISC_LOG_WARNING, DNS_LOGMODULE_CACHE, ISC_LOG_WARNING,
"delete_node(): " "delete_node(): "
"dns_rbt_deletenode(nsecnode): %s", "dns_rbt_deletenode(nsecnode): %s",
@ -1108,8 +1107,8 @@ delete_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) {
break; break;
} }
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE,
DNS_LOGMODULE_CACHE, ISC_LOG_WARNING, ISC_LOG_WARNING,
"delete_node(): " "delete_node(): "
"dns_rbt_deletenode: %s", "dns_rbt_deletenode: %s",
isc_result_totext(result)); isc_result_totext(result));
@ -2300,7 +2299,7 @@ dns__rbtdb_detachnode(dns_db_t *db, dns_dbnode_t **targetp DNS__DB_FLARG) {
} else { } else {
strlcpy(buf, "<UNKNOWN>", sizeof(buf)); strlcpy(buf, "<UNKNOWN>", sizeof(buf));
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, isc_log_write(DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1), DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1),
"calling free_rbtdb(%s)", buf); "calling free_rbtdb(%s)", buf);
free_rbtdb(rbtdb, true); free_rbtdb(rbtdb, true);

View File

@ -1055,7 +1055,7 @@ req_log(int level, const char *fmt, ...) {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_REQUEST, isc_log_vwrite(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_REQUEST, level,
level, fmt, ap); fmt, ap);
va_end(ap); va_end(ap);
} }

View File

@ -75,47 +75,40 @@
#include <dns/zone.h> #include <dns/zone.h>
#ifdef WANT_QUERYTRACE #ifdef WANT_QUERYTRACE
#define RTRACE(m) \ #define RTRACE(m) \
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, \ isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, \
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), "res %p: %s", \ ISC_LOG_DEBUG(3), "res %p: %s", res, (m))
res, (m)) #define RRTRACE(r, m) \
#define RRTRACE(r, m) \ isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, \
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, \ ISC_LOG_DEBUG(3), "res %p: %s", (r), (m))
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), "res %p: %s", \ #define FCTXTRACE(m) \
(r), (m)) isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, \
#define FCTXTRACE(m) \ ISC_LOG_DEBUG(3), "fctx %p(%s): %s", fctx, fctx->info, \
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, \ (m))
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), \ #define FCTXTRACE2(m1, m2) \
"fctx %p(%s): %s", fctx, fctx->info, (m)) isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, \
#define FCTXTRACE2(m1, m2) \ ISC_LOG_DEBUG(3), "fctx %p(%s): %s %s", fctx, \
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, \ fctx->info, (m1), (m2))
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), \ #define FCTXTRACE3(m, res) \
"fctx %p(%s): %s %s", fctx, fctx->info, (m1), (m2)) isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, \
#define FCTXTRACE3(m, res) \ ISC_LOG_DEBUG(3), "fctx %p(%s): [result: %s] %s", fctx, \
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, \ fctx->info, isc_result_totext(res), (m))
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), \
"fctx %p(%s): [result: %s] %s", fctx, fctx->info, \
isc_result_totext(res), (m))
#define FCTXTRACE4(m1, m2, res) \ #define FCTXTRACE4(m1, m2, res) \
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, \ isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, \
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), \ ISC_LOG_DEBUG(3), "fctx %p(%s): [result: %s] %s %s", \
"fctx %p(%s): [result: %s] %s %s", fctx, fctx->info, \ fctx, fctx->info, isc_result_totext(res), (m1), (m2))
isc_result_totext(res), (m1), (m2)) #define FCTXTRACE5(m1, m2, v) \
#define FCTXTRACE5(m1, m2, v) \ isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, \
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, \ ISC_LOG_DEBUG(3), "fctx %p(%s): %s %s%u", fctx, \
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), \ fctx->info, (m1), (m2), (v))
"fctx %p(%s): %s %s%u", fctx, fctx->info, (m1), (m2), \ #define FTRACE(m) \
(v)) isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, \
#define FTRACE(m) \ ISC_LOG_DEBUG(3), "fetch %p (fctx %p(%s)): %s", fetch, \
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, \ fetch->private, fetch->private->info, (m))
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), \ #define QTRACE(m) \
"fetch %p (fctx %p(%s)): %s", fetch, fetch->private, \ isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, \
fetch->private->info, (m)) ISC_LOG_DEBUG(3), "resquery %p (fctx %p(%s)): %s", \
#define QTRACE(m) \ query, query->fctx, query->fctx->info, (m))
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, \
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), \
"resquery %p (fctx %p(%s)): %s", query, query->fctx, \
query->fctx->info, (m))
#else /* ifdef WANT_QUERYTRACE */ #else /* ifdef WANT_QUERYTRACE */
#define RTRACE(m) \ #define RTRACE(m) \
do { \ do { \
@ -1378,7 +1371,7 @@ fcount_logspill(fetchctx_t *fctx, fctxcount_t *counter, bool final) {
char dbuf[DNS_NAME_FORMATSIZE]; char dbuf[DNS_NAME_FORMATSIZE];
isc_stdtime_t now; isc_stdtime_t now;
if (!isc_log_wouldlog(dns_lctx, ISC_LOG_INFO)) { if (!isc_log_wouldlog(ISC_LOG_INFO)) {
return; return;
} }
@ -1396,8 +1389,8 @@ fcount_logspill(fetchctx_t *fctx, fctxcount_t *counter, bool final) {
dns_name_format(fctx->domain, dbuf, sizeof(dbuf)); dns_name_format(fctx->domain, dbuf, sizeof(dbuf));
if (!final) { if (!final) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_SPILL, isc_log_write(DNS_LOGCATEGORY_SPILL, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, ISC_LOG_INFO,
"too many simultaneous fetches for %s " "too many simultaneous fetches for %s "
"(allowed %" PRIuFAST32 " spilled %" PRIuFAST32 "(allowed %" PRIuFAST32 " spilled %" PRIuFAST32
"; %s)", "; %s)",
@ -1406,8 +1399,8 @@ fcount_logspill(fetchctx_t *fctx, fctxcount_t *counter, bool final) {
: "cumulative since " : "cumulative since "
"initial trigger event"); "initial trigger event");
} else { } else {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_SPILL, isc_log_write(DNS_LOGCATEGORY_SPILL, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, ISC_LOG_INFO,
"fetch counters for %s now being discarded " "fetch counters for %s now being discarded "
"(allowed %" PRIuFAST32 " spilled %" PRIuFAST32 "(allowed %" PRIuFAST32 " spilled %" PRIuFAST32
"; cumulative since initial trigger event)", "; cumulative since initial trigger event)",
@ -1644,7 +1637,7 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result) {
} }
UNLOCK(&fctx->res->lock); UNLOCK(&fctx->res->lock);
if (logit) { if (logit) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE, DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE,
"clients-per-query increased to %u", "clients-per-query increased to %u",
new_spillat); new_spillat);
@ -1686,7 +1679,7 @@ fctx__done(fetchctx_t *fctx, isc_result_t result, const char *func,
if (result == ISC_R_SUCCESS) { if (result == ISC_R_SUCCESS) {
if (fctx->qmin_warning != ISC_R_SUCCESS) { if (fctx->qmin_warning != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_LAME_SERVERS, isc_log_write(DNS_LOGCATEGORY_LAME_SERVERS,
DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO,
"success resolving '%s' after disabling " "success resolving '%s' after disabling "
"qname minimization due to '%s'", "qname minimization due to '%s'",
@ -1997,7 +1990,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
/* format new address */ /* format new address */
isc_sockaddr_format(&sockaddr, sockaddrbuf2, isc_sockaddr_format(&sockaddr, sockaddrbuf2,
sizeof(sockaddrbuf2)); sizeof(sockaddrbuf2));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3),
"Using DNS64 address %s to talk to %s\n", "Using DNS64 address %s to talk to %s\n",
sockaddrbuf2, sockaddrbuf1); sockaddrbuf2, sockaddrbuf1);
@ -2133,14 +2126,14 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
if (result != ISC_R_SUCCESS && (query->options & DNS_FETCHOPT_TCP) != 0) if (result != ISC_R_SUCCESS && (query->options & DNS_FETCHOPT_TCP) != 0)
{ {
int log_level = ISC_LOG_NOTICE; int log_level = ISC_LOG_NOTICE;
if (isc_log_wouldlog(dns_lctx, log_level)) { if (isc_log_wouldlog(log_level)) {
char peerbuf[ISC_SOCKADDR_FORMATSIZE]; char peerbuf[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(&sockaddr, peerbuf, isc_sockaddr_format(&sockaddr, peerbuf,
ISC_SOCKADDR_FORMATSIZE); ISC_SOCKADDR_FORMATSIZE);
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGCATEGORY_RESOLVER,
DNS_LOGMODULE_RESOLVER, log_level, DNS_LOGMODULE_RESOLVER, log_level,
"Unable to establish a connection to %s: %s\n", "Unable to establish a connection to %s: %s\n",
peerbuf, isc_result_totext(result)); peerbuf, isc_result_totext(result));
@ -3118,10 +3111,10 @@ add_bad(fetchctx_t *fctx, dns_message_t *rmessage, dns_adbaddrinfo_t *addrinfo,
dns_rdatatype_format(fctx->type, typebuf, sizeof(typebuf)); dns_rdatatype_format(fctx->type, typebuf, sizeof(typebuf));
dns_rdataclass_format(fctx->res->rdclass, classbuf, sizeof(classbuf)); dns_rdataclass_format(fctx->res->rdclass, classbuf, sizeof(classbuf));
isc_sockaddr_format(address, addrbuf, sizeof(addrbuf)); isc_sockaddr_format(address, addrbuf, sizeof(addrbuf));
isc_log_write( isc_log_write(DNS_LOGCATEGORY_LAME_SERVERS, DNS_LOGMODULE_RESOLVER,
dns_lctx, DNS_LOGCATEGORY_LAME_SERVERS, DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, "%s%s%s resolving '%s/%s/%s': %s", code,
ISC_LOG_INFO, "%s%s%s resolving '%s/%s/%s': %s", code, spc, spc, isc_result_totext(reason), namebuf, typebuf,
isc_result_totext(reason), namebuf, typebuf, classbuf, addrbuf); classbuf, addrbuf);
} }
/* /*
@ -3273,10 +3266,10 @@ findname(fetchctx_t *fctx, const dns_name_t *name, in_port_t port,
NULL, res->view->dstport, fctx->depth + 1, NULL, res->view->dstport, fctx->depth + 1,
fctx->qc, &find); fctx->qc, &find);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3), "fctx %p(%s): createfind for %s - %s",
"fctx %p(%s): createfind for %s - %s", fctx, fctx->info, fctx, fctx->info, fctx->clientstr,
fctx->clientstr, isc_result_totext(result)); isc_result_totext(result));
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
if (result == DNS_R_ALIAS) { if (result == DNS_R_ALIAS) {
@ -3288,7 +3281,7 @@ findname(fetchctx_t *fctx, const dns_name_t *name, in_port_t port,
dns_adb_destroyfind(&find); dns_adb_destroyfind(&find);
fctx->adberr++; fctx->adberr++;
dns_name_format(name, namebuf, sizeof(namebuf)); dns_name_format(name, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_CNAME, isc_log_write(DNS_LOGCATEGORY_CNAME,
DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO,
"skipping nameserver '%s' because it " "skipping nameserver '%s' because it "
"is a CNAME, while resolving '%s'", "is a CNAME, while resolving '%s'",
@ -3333,9 +3326,9 @@ findname(fetchctx_t *fctx, const dns_name_t *name, in_port_t port,
*/ */
if (waiting_for(find, fctx->type) && dns_name_equal(name, fctx->name)) { if (waiting_for(find, fctx->type) && dns_name_equal(name, fctx->name)) {
fctx->adberr++; fctx->adberr++;
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, ISC_LOG_INFO, "loop detected resolving '%s'",
"loop detected resolving '%s'", fctx->info); fctx->info);
if ((find->options & DNS_ADBFIND_WANTEVENT) != 0) { if ((find->options & DNS_ADBFIND_WANTEVENT) != 0) {
atomic_fetch_add_relaxed(&fctx->pending, 1); atomic_fetch_add_relaxed(&fctx->pending, 1);
@ -3437,8 +3430,8 @@ fctx_getaddresses(fetchctx_t *fctx, bool badcache) {
res = fctx->res; res = fctx->res;
if (fctx->depth > res->maxdepth) { if (fctx->depth > res->maxdepth) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3),
"too much NS indirection resolving '%s' " "too much NS indirection resolving '%s' "
"(depth=%u, maxdepth=%u)", "(depth=%u, maxdepth=%u)",
fctx->info, fctx->depth, res->maxdepth); fctx->info, fctx->depth, res->maxdepth);
@ -3794,7 +3787,7 @@ possibly_mark(fetchctx_t *fctx, dns_adbaddrinfo_t *addr) {
return; return;
} }
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
char buf[ISC_NETADDR_FORMATSIZE]; char buf[ISC_NETADDR_FORMATSIZE];
isc_netaddr_fromsockaddr(&na, sa); isc_netaddr_fromsockaddr(&na, sa);
isc_netaddr_format(&na, buf, sizeof(buf)); isc_netaddr_format(&na, buf, sizeof(buf));
@ -3983,8 +3976,8 @@ fctx_try(fetchctx_t *fctx, bool retrying, bool badcache) {
/* We've already exceeded maximum query count */ /* We've already exceeded maximum query count */
if (isc_counter_used(fctx->qc) > res->maxqueries) { if (isc_counter_used(fctx->qc) > res->maxqueries) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3),
"exceeded max queries resolving '%s' " "exceeded max queries resolving '%s' "
"(querycount=%u, maxqueries=%u)", "(querycount=%u, maxqueries=%u)",
fctx->info, isc_counter_used(fctx->qc), fctx->info, isc_counter_used(fctx->qc),
@ -4057,7 +4050,7 @@ fctx_try(fetchctx_t *fctx, bool retrying, bool badcache) {
dns_rdatatype_format(fctx->qmintype, typebuf, dns_rdatatype_format(fctx->qmintype, typebuf,
sizeof(typebuf)); sizeof(typebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_ERROR, DNS_LOGMODULE_RESOLVER, ISC_LOG_ERROR,
"fctx %p(%s): attempting QNAME " "fctx %p(%s): attempting QNAME "
"minimization fetch for %s/%s but " "minimization fetch for %s/%s but "
@ -4097,8 +4090,8 @@ fctx_try(fetchctx_t *fctx, bool retrying, bool badcache) {
result = isc_counter_increment(fctx->qc); result = isc_counter_increment(fctx->qc);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3),
"exceeded max queries resolving '%s'", "exceeded max queries resolving '%s'",
fctx->info); fctx->info);
goto done; goto done;
@ -4219,8 +4212,8 @@ resume_qmin(void *arg) {
break; break;
default: default:
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(5), ISC_LOG_DEBUG(5),
"QNAME minimization: unexpected result %s", "QNAME minimization: unexpected result %s",
isc_result_totext(result)); isc_result_totext(result));
break; break;
@ -4356,8 +4349,8 @@ fctx_expired(void *arg) {
REQUIRE(VALID_FCTX(fctx)); REQUIRE(VALID_FCTX(fctx));
REQUIRE(fctx->tid == isc_tid()); REQUIRE(fctx->tid == isc_tid());
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, ISC_LOG_INFO,
"shut down hung fetch while resolving %p(%s)", fctx, "shut down hung fetch while resolving %p(%s)", fctx,
fctx->info); fctx->info);
fctx_done_detach(&fctx, DNS_R_SERVFAIL); fctx_done_detach(&fctx, DNS_R_SERVFAIL);
@ -4472,8 +4465,8 @@ log_ns_ttl(fetchctx_t *fctx, const char *where) {
dns_name_format(fctx->name, namebuf, sizeof(namebuf)); dns_name_format(fctx->name, namebuf, sizeof(namebuf));
dns_name_format(fctx->domain, domainbuf, sizeof(domainbuf)); dns_name_format(fctx->domain, domainbuf, sizeof(domainbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(10), ISC_LOG_DEBUG(10),
"log_ns_ttl: fctx %p: %s: %s (in '%s'?): %u %u", fctx, "log_ns_ttl: fctx %p: %s: %s (in '%s'?): %u %u", fctx,
where, namebuf, domainbuf, fctx->ns_ttl_ok, fctx->ns_ttl); where, namebuf, domainbuf, fctx->ns_ttl_ok, fctx->ns_ttl);
} }
@ -4534,8 +4527,8 @@ fctx_create(dns_resolver_t *res, isc_loop_t *loop, const dns_name_t *name,
if (qc != NULL) { if (qc != NULL) {
isc_counter_attach(qc, &fctx->qc); isc_counter_attach(qc, &fctx->qc);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(9), ISC_LOG_DEBUG(9),
"fctx %p(%s): attached to counter %p (%d)", fctx, "fctx %p(%s): attached to counter %p (%d)", fctx,
fctx->info, fctx->qc, isc_counter_used(fctx->qc)); fctx->info, fctx->qc, isc_counter_used(fctx->qc));
} else { } else {
@ -4544,8 +4537,8 @@ fctx_create(dns_resolver_t *res, isc_loop_t *loop, const dns_name_t *name,
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
goto cleanup_fetch; goto cleanup_fetch;
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(9), ISC_LOG_DEBUG(9),
"fctx %p(%s): created counter %p", fctx, "fctx %p(%s): created counter %p", fctx,
fctx->info, fctx->qc); fctx->info, fctx->qc);
} }
@ -4826,10 +4819,9 @@ log_lame(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo) {
dns_name_format(fctx->name, namebuf, sizeof(namebuf)); dns_name_format(fctx->name, namebuf, sizeof(namebuf));
dns_name_format(fctx->domain, domainbuf, sizeof(domainbuf)); dns_name_format(fctx->domain, domainbuf, sizeof(domainbuf));
isc_sockaddr_format(&addrinfo->sockaddr, addrbuf, sizeof(addrbuf)); isc_sockaddr_format(&addrinfo->sockaddr, addrbuf, sizeof(addrbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_LAME_SERVERS, isc_log_write(DNS_LOGCATEGORY_LAME_SERVERS, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, ISC_LOG_INFO, "lame server resolving '%s' (in '%s'?): %s",
"lame server resolving '%s' (in '%s'?): %s", namebuf, namebuf, domainbuf, addrbuf);
domainbuf, addrbuf);
} }
static void static void
@ -4844,8 +4836,8 @@ log_formerr(fetchctx_t *fctx, const char *format, ...) {
isc_sockaddr_format(&fctx->addrinfo->sockaddr, nsbuf, sizeof(nsbuf)); isc_sockaddr_format(&fctx->addrinfo->sockaddr, nsbuf, sizeof(nsbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"DNS format error from %s resolving %s for %s: %s", nsbuf, "DNS format error from %s resolving %s for %s: %s", nsbuf,
fctx->info, fctx->clientstr, msgbuf); fctx->info, fctx->clientstr, msgbuf);
} }
@ -5643,9 +5635,8 @@ fctx_log(void *arg, int level, const char *fmt, ...) {
vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); vsnprintf(msgbuf, sizeof(msgbuf), fmt, args);
va_end(args); va_end(args);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, level,
DNS_LOGMODULE_RESOLVER, level, "fctx %p(%s): %s", fctx, "fctx %p(%s): %s", fctx, fctx->info, msgbuf);
fctx->info, msgbuf);
} }
static isc_result_t static isc_result_t
@ -5891,7 +5882,7 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
sizeof(typebuf)); sizeof(typebuf));
dns_rdataclass_format(rdataset->rdclass, classbuf, dns_rdataclass_format(rdataset->rdclass, classbuf,
sizeof(classbuf)); sizeof(classbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE, DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE,
"check-names %s %s/%s/%s", "check-names %s %s/%s/%s",
fail ? "failure" : "warning", namebuf, fail ? "failure" : "warning", namebuf,
@ -6802,7 +6793,7 @@ is_answeraddress_allowed(dns_view_t *view, dns_name_t *name,
sizeof(typebuf)); sizeof(typebuf));
dns_rdataclass_format(rdataset->rdclass, classbuf, dns_rdataclass_format(rdataset->rdclass, classbuf,
sizeof(classbuf)); sizeof(classbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE, DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE,
"answer address %s denied for %s/%s/%s", "answer address %s denied for %s/%s/%s",
addrbuf, namebuf, typebuf, classbuf); addrbuf, namebuf, typebuf, classbuf);
@ -6912,10 +6903,9 @@ is_answertarget_allowed(fetchctx_t *fctx, dns_name_t *qname, dns_name_t *rname,
dns_rdatatype_format(rdataset->type, typebuf, sizeof(typebuf)); dns_rdatatype_format(rdataset->type, typebuf, sizeof(typebuf));
dns_rdataclass_format(view->rdclass, classbuf, dns_rdataclass_format(view->rdclass, classbuf,
sizeof(classbuf)); sizeof(classbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE, ISC_LOG_NOTICE, "%s target %s denied for %s/%s",
"%s target %s denied for %s/%s", typebuf, typebuf, tnamebuf, qnamebuf, classbuf);
tnamebuf, qnamebuf, classbuf);
return (false); return (false);
} }
@ -6933,8 +6923,8 @@ trim_ns_ttl(fetchctx_t *fctx, dns_name_t *name, dns_rdataset_t *rdataset) {
dns_name_format(fctx->name, namebuf, sizeof(namebuf)); dns_name_format(fctx->name, namebuf, sizeof(namebuf));
dns_rdatatype_format(fctx->type, tbuf, sizeof(tbuf)); dns_rdatatype_format(fctx->type, tbuf, sizeof(tbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(10), ISC_LOG_DEBUG(10),
"fctx %p: trimming ttl of %s/NS for %s/%s: " "fctx %p: trimming ttl of %s/NS for %s/%s: "
"%u -> %u", "%u -> %u",
fctx, ns_namebuf, namebuf, tbuf, rdataset->ttl, fctx, ns_namebuf, namebuf, tbuf, rdataset->ttl,
@ -7240,9 +7230,8 @@ log_nsid(isc_buffer_t *opt, size_t nsid_len, resquery_t *query, int level,
isc_sockaddr_format(&query->addrinfo->sockaddr, addrbuf, isc_sockaddr_format(&query->addrinfo->sockaddr, addrbuf,
sizeof(addrbuf)); sizeof(addrbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_NSID, DNS_LOGMODULE_RESOLVER, isc_log_write(DNS_LOGCATEGORY_NSID, DNS_LOGMODULE_RESOLVER, level,
level, "received NSID %s (\"%s\") from %s", buf, pbuf, "received NSID %s (\"%s\") from %s", buf, pbuf, addrbuf);
addrbuf);
isc_mem_put(mctx, pbuf, nsid_len + 1); isc_mem_put(mctx, pbuf, nsid_len + 1);
isc_mem_put(mctx, buf, buflen); isc_mem_put(mctx, buf, buflen);
@ -7406,11 +7395,11 @@ resquery_response(isc_result_t eresult, isc_region_t *region, void *arg) {
* keep listening for a good answer. * keep listening for a good answer.
*/ */
rctx->nextitem = true; rctx->nextitem = true;
if (isc_log_wouldlog(dns_lctx, ISC_LOG_INFO)) { if (isc_log_wouldlog(ISC_LOG_INFO)) {
char addrbuf[ISC_SOCKADDR_FORMATSIZE]; char addrbuf[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(&query->addrinfo->sockaddr, addrbuf, isc_sockaddr_format(&query->addrinfo->sockaddr, addrbuf,
sizeof(addrbuf)); sizeof(addrbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO,
"bad cookie from %s", addrbuf); "bad cookie from %s", addrbuf);
} }
@ -7513,16 +7502,16 @@ resquery_response_continue(void *arg, isc_result_t result) {
if (dns_adb_getcookie(query->addrinfo, NULL, 0) > if (dns_adb_getcookie(query->addrinfo, NULL, 0) >
CLIENT_COOKIE_SIZE) CLIENT_COOKIE_SIZE)
{ {
if (isc_log_wouldlog(dns_lctx, ISC_LOG_INFO)) { if (isc_log_wouldlog(ISC_LOG_INFO)) {
char addrbuf[ISC_SOCKADDR_FORMATSIZE]; char addrbuf[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(&query->addrinfo->sockaddr, isc_sockaddr_format(&query->addrinfo->sockaddr,
addrbuf, sizeof(addrbuf)); addrbuf, sizeof(addrbuf));
isc_log_write( isc_log_write(DNS_LOGCATEGORY_RESOLVER,
dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, ISC_LOG_INFO,
"missing expected cookie " "missing expected cookie "
"from %s", "from %s",
addrbuf); addrbuf);
} }
rctx->retryopts |= DNS_FETCHOPT_TCP; rctx->retryopts |= DNS_FETCHOPT_TCP;
rctx->resend = true; rctx->resend = true;
@ -7540,9 +7529,7 @@ resquery_response_continue(void *arg, isc_result_t result) {
result = dns_peer_getrequirecookie(peer, result = dns_peer_getrequirecookie(peer,
&required); &required);
if (result == ISC_R_SUCCESS && required) { if (result == ISC_R_SUCCESS && required) {
if (isc_log_wouldlog(dns_lctx, if (isc_log_wouldlog(ISC_LOG_INFO)) {
ISC_LOG_INFO))
{
char addrbuf char addrbuf
[ISC_SOCKADDR_FORMATSIZE]; [ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format( isc_sockaddr_format(
@ -7551,7 +7538,6 @@ resquery_response_continue(void *arg, isc_result_t result) {
addrbuf, addrbuf,
sizeof(addrbuf)); sizeof(addrbuf));
isc_log_write( isc_log_write(
dns_lctx,
DNS_LOGCATEGORY_RESOLVER, DNS_LOGCATEGORY_RESOLVER,
DNS_LOGMODULE_RESOLVER, DNS_LOGMODULE_RESOLVER,
ISC_LOG_INFO, ISC_LOG_INFO,
@ -9957,8 +9943,8 @@ spillattimer_countdown(void *arg) {
} }
UNLOCK(&res->lock); UNLOCK(&res->lock);
if (spillat > 0) { if (spillat > 0) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE, ISC_LOG_NOTICE,
"clients-per-query decreased to %u", spillat); "clients-per-query decreased to %u", spillat);
} }
} }
@ -10072,8 +10058,7 @@ prime_done(void *arg) {
int level = (resp->result == ISC_R_SUCCESS) ? ISC_LOG_DEBUG(1) int level = (resp->result == ISC_R_SUCCESS) ? ISC_LOG_DEBUG(1)
: ISC_LOG_NOTICE; : ISC_LOG_NOTICE;
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, level,
DNS_LOGMODULE_RESOLVER, level,
"resolver priming query complete: %s", "resolver priming query complete: %s",
isc_result_totext(resp->result)); isc_result_totext(resp->result));
@ -10221,16 +10206,15 @@ log_fetch(const dns_name_t *name, dns_rdatatype_t type) {
* If there's no chance of logging it, don't render (format) the * If there's no chance of logging it, don't render (format) the
* name and RDATA type (further below), and return early. * name and RDATA type (further below), and return early.
*/ */
if (!isc_log_wouldlog(dns_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
dns_name_format(name, namebuf, sizeof(namebuf)); dns_name_format(name, namebuf, sizeof(namebuf));
dns_rdatatype_format(type, typebuf, sizeof(typebuf)); dns_rdatatype_format(type, typebuf, sizeof(typebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, level,
DNS_LOGMODULE_RESOLVER, level, "fetch: %s/%s", namebuf, "fetch: %s/%s", namebuf, typebuf);
typebuf);
} }
static void static void
@ -10330,8 +10314,8 @@ fctx_minimize_qname(fetchctx_t *fctx) {
char domainbuf[DNS_NAME_FORMATSIZE]; char domainbuf[DNS_NAME_FORMATSIZE];
dns_name_format(fctx->qminname, domainbuf, sizeof(domainbuf)); dns_name_format(fctx->qminname, domainbuf, sizeof(domainbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(5), ISC_LOG_DEBUG(5),
"QNAME minimization - %s minimized, qmintype %d " "QNAME minimization - %s minimized, qmintype %d "
"qminname %s", "qminname %s",
fctx->minimized ? "" : "not", fctx->qmintype, domainbuf); fctx->minimized ? "" : "not", fctx->qmintype, domainbuf);
@ -10627,9 +10611,8 @@ dns_resolver_destroyfetch(dns_fetch_t **fetchp) {
} }
void void
dns_resolver_logfetch(dns_fetch_t *fetch, isc_log_t *lctx, dns_resolver_logfetch(dns_fetch_t *fetch, isc_logcategory_t *category,
isc_logcategory_t *category, isc_logmodule_t *module, isc_logmodule_t *module, int level, bool duplicateok) {
int level, bool duplicateok) {
fetchctx_t *fctx = NULL; fetchctx_t *fctx = NULL;
REQUIRE(DNS_FETCH_VALID(fetch)); REQUIRE(DNS_FETCH_VALID(fetch));
@ -10641,7 +10624,7 @@ dns_resolver_logfetch(dns_fetch_t *fetch, isc_log_t *lctx,
if (!fctx->logged || duplicateok) { if (!fctx->logged || duplicateok) {
char domainbuf[DNS_NAME_FORMATSIZE]; char domainbuf[DNS_NAME_FORMATSIZE];
dns_name_format(fctx->domain, domainbuf, sizeof(domainbuf)); dns_name_format(fctx->domain, domainbuf, sizeof(domainbuf));
isc_log_write(lctx, category, module, level, isc_log_write(category, module, level,
"fetch completed for %s in " "fetch completed for %s in "
"%" PRIu64 "." "%" PRIu64 "."
"%06" PRIu64 ": %s/%s " "%06" PRIu64 ": %s/%s "

View File

@ -279,16 +279,15 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
goto failure; goto failure;
} }
if (check_hints(db) != ISC_R_SUCCESS) { if (check_hints(db) != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_HINTS,
DNS_LOGMODULE_HINTS, ISC_LOG_WARNING, ISC_LOG_WARNING, "extra data in root hints '%s'",
"extra data in root hints '%s'",
(filename != NULL) ? filename : "<BUILT-IN>"); (filename != NULL) ? filename : "<BUILT-IN>");
} }
*target = db; *target = db;
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
failure: failure:
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_HINTS, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_HINTS,
ISC_LOG_ERROR, ISC_LOG_ERROR,
"could not configure root hints from " "could not configure root hints from "
"'%s': %s", "'%s': %s",
@ -326,13 +325,13 @@ report(dns_view_t *view, dns_name_t *name, bool missing, dns_rdata_t *rdata) {
databuf[isc_buffer_usedlength(&buffer)] = '\0'; databuf[isc_buffer_usedlength(&buffer)] = '\0';
if (missing) { if (missing) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_HINTS,
DNS_LOGMODULE_HINTS, ISC_LOG_WARNING, ISC_LOG_WARNING,
"checkhints%s%s: %s/%s (%s) missing from hints", "checkhints%s%s: %s/%s (%s) missing from hints",
sep, viewname, namebuf, typebuf, databuf); sep, viewname, namebuf, typebuf, databuf);
} else { } else {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_HINTS,
DNS_LOGMODULE_HINTS, ISC_LOG_WARNING, ISC_LOG_WARNING,
"checkhints%s%s: %s/%s (%s) extra record " "checkhints%s%s: %s/%s (%s) extra record "
"in hints", "in hints",
sep, viewname, namebuf, typebuf, databuf); sep, viewname, namebuf, typebuf, databuf);
@ -521,8 +520,8 @@ dns_root_checkhints(dns_view_t *view, dns_db_t *hints, dns_db_t *db) {
result = dns_db_find(hints, dns_rootname, NULL, dns_rdatatype_ns, 0, result = dns_db_find(hints, dns_rootname, NULL, dns_rdatatype_ns, 0,
now, NULL, name, &hintns, NULL); now, NULL, name, &hintns, NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_HINTS,
DNS_LOGMODULE_HINTS, ISC_LOG_WARNING, ISC_LOG_WARNING,
"checkhints%s%s: unable to get root NS rrset " "checkhints%s%s: unable to get root NS rrset "
"from hints: %s", "from hints: %s",
sep, viewname, isc_result_totext(result)); sep, viewname, isc_result_totext(result));
@ -532,8 +531,8 @@ dns_root_checkhints(dns_view_t *view, dns_db_t *hints, dns_db_t *db) {
result = dns_db_find(db, dns_rootname, NULL, dns_rdatatype_ns, 0, now, result = dns_db_find(db, dns_rootname, NULL, dns_rdatatype_ns, 0, now,
NULL, name, &rootns, NULL); NULL, name, &rootns, NULL);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_HINTS,
DNS_LOGMODULE_HINTS, ISC_LOG_WARNING, ISC_LOG_WARNING,
"checkhints%s%s: unable to get root NS rrset " "checkhints%s%s: unable to get root NS rrset "
"from cache: %s", "from cache: %s",
sep, viewname, isc_result_totext(result)); sep, viewname, isc_result_totext(result));
@ -553,7 +552,7 @@ dns_root_checkhints(dns_view_t *view, dns_db_t *hints, dns_db_t *db) {
char namebuf[DNS_NAME_FORMATSIZE]; char namebuf[DNS_NAME_FORMATSIZE];
/* missing from hints */ /* missing from hints */
dns_name_format(&ns.name, namebuf, sizeof(namebuf)); dns_name_format(&ns.name, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_HINTS, ISC_LOG_WARNING, DNS_LOGMODULE_HINTS, ISC_LOG_WARNING,
"checkhints%s%s: unable to find root " "checkhints%s%s: unable to find root "
"NS '%s' in hints", "NS '%s' in hints",
@ -581,7 +580,7 @@ dns_root_checkhints(dns_view_t *view, dns_db_t *hints, dns_db_t *db) {
char namebuf[DNS_NAME_FORMATSIZE]; char namebuf[DNS_NAME_FORMATSIZE];
/* extra entry in hints */ /* extra entry in hints */
dns_name_format(&ns.name, namebuf, sizeof(namebuf)); dns_name_format(&ns.name, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_HINTS, ISC_LOG_WARNING, DNS_LOGMODULE_HINTS, ISC_LOG_WARNING,
"checkhints%s%s: extra NS '%s' in hints", "checkhints%s%s: extra NS '%s' in hints",
sep, viewname, namebuf); sep, viewname, namebuf);

View File

@ -610,7 +610,7 @@ fix_qname_skip_recurse(dns_rpz_zones_t *rpzs) {
} }
set: set:
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_RPZ_DEBUG_QUIET, DNS_RPZ_DEBUG_QUIET,
"computed RPZ qname_skip_recurse mask=0x%" PRIx64, "computed RPZ qname_skip_recurse mask=0x%" PRIx64,
(uint64_t)mask); (uint64_t)mask);
@ -719,11 +719,10 @@ badname(int level, const dns_name_t *name, const char *str1, const char *str2) {
/* /*
* bin/tests/system/rpz/tests.sh looks for "invalid rpz". * bin/tests/system/rpz/tests.sh looks for "invalid rpz".
*/ */
if (level < DNS_RPZ_DEBUG_QUIET && isc_log_wouldlog(dns_lctx, level)) { if (level < DNS_RPZ_DEBUG_QUIET && isc_log_wouldlog(level)) {
char namebuf[DNS_NAME_FORMATSIZE]; char namebuf[DNS_NAME_FORMATSIZE];
dns_name_format(name, namebuf, sizeof(namebuf)); dns_name_format(name, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB, level,
DNS_LOGMODULE_RBTDB, level,
"invalid rpz IP address \"%s\"%s%s", namebuf, "invalid rpz IP address \"%s\"%s%s", namebuf,
str1, str2); str1, str2);
} }
@ -1012,9 +1011,7 @@ name2ipkey(int log_level, dns_rpz_zone_t *rpz, dns_rpz_type_t rpz_type,
/* /*
* Complain about bad names but be generous and accept them. * Complain about bad names but be generous and accept them.
*/ */
if (log_level < DNS_RPZ_DEBUG_QUIET && if (log_level < DNS_RPZ_DEBUG_QUIET && isc_log_wouldlog(log_level)) {
isc_log_wouldlog(dns_lctx, log_level))
{
/* /*
* Convert the address back to a canonical domain name * Convert the address back to a canonical domain name
* to ensure that the original name is in canonical form. * to ensure that the original name is in canonical form.
@ -1027,8 +1024,8 @@ name2ipkey(int log_level, dns_rpz_zone_t *rpz, dns_rpz_type_t rpz_type,
{ {
char ip2_str[DNS_NAME_FORMATSIZE]; char ip2_str[DNS_NAME_FORMATSIZE];
dns_name_format(ip_name2, ip2_str, sizeof(ip2_str)); dns_name_format(ip_name2, ip2_str, sizeof(ip2_str));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_LOGMODULE_RBTDB, log_level, log_level,
"rpz IP address \"%s\"" "rpz IP address \"%s\""
" is not the canonical \"%s\"", " is not the canonical \"%s\"",
ip_str, ip2_str); ip_str, ip2_str);
@ -1388,8 +1385,8 @@ add_cidr(dns_rpz_zone_t *rpz, dns_rpz_type_t rpz_type,
* bin/tests/system/rpz/tests.sh looks for "rpz.*failed". * bin/tests/system/rpz/tests.sh looks for "rpz.*failed".
*/ */
dns_name_format(src_name, namebuf, sizeof(namebuf)); dns_name_format(src_name, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_LOGMODULE_RBTDB, DNS_RPZ_ERROR_LEVEL, DNS_RPZ_ERROR_LEVEL,
"rpz add_cidr(%s) failed: %s", namebuf, "rpz add_cidr(%s) failed: %s", namebuf,
isc_result_totext(result)); isc_result_totext(result));
goto done; goto done;
@ -1647,8 +1644,8 @@ dns_rpz_dbupdate_callback(dns_db_t *db, void *fn_arg) {
rpz->updatepending = true; rpz->updatepending = true;
dns_name_format(&rpz->origin, dname, DNS_NAME_FORMATSIZE); dns_name_format(&rpz->origin, dname, DNS_NAME_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3),
"rpz: %s: update already queued or running", "rpz: %s: update already queued or running",
dname); dname);
if (rpz->dbversion != NULL) { if (rpz->dbversion != NULL) {
@ -1693,8 +1690,8 @@ dns__rpz_timer_start(dns_rpz_zone_t *rpz) {
char dname[DNS_NAME_FORMATSIZE]; char dname[DNS_NAME_FORMATSIZE];
dns_name_format(&rpz->origin, dname, DNS_NAME_FORMATSIZE); dns_name_format(&rpz->origin, dname, DNS_NAME_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_INFO, ISC_LOG_INFO,
"rpz: %s: new zone version came " "rpz: %s: new zone version came "
"too soon, deferring update for " "too soon, deferring update for "
"%" PRIu64 " seconds", "%" PRIu64 " seconds",
@ -1744,7 +1741,7 @@ update_rpz_done_cb(void *data) {
UNLOCK(&rpz->rpzs->maint_lock); UNLOCK(&rpz->rpzs->maint_lock);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
ISC_LOG_INFO, "rpz: %s: reload done: %s", dname, ISC_LOG_INFO, "rpz: %s: reload done: %s", dname,
isc_result_totext(rpz->updateresult)); isc_result_totext(rpz->updateresult));
@ -1765,8 +1762,8 @@ update_nodes(dns_rpz_zone_t *rpz, isc_ht_t *newnodes) {
result = dns_db_createiterator(rpz->updb, DNS_DB_NONSEC3, &updbit); result = dns_db_createiterator(rpz->updb, DNS_DB_NONSEC3, &updbit);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, ISC_LOG_ERROR,
"rpz: %s: failed to create DB iterator - %s", "rpz: %s: failed to create DB iterator - %s",
domain, isc_result_totext(result)); domain, isc_result_totext(result));
return (result); return (result);
@ -1774,8 +1771,8 @@ update_nodes(dns_rpz_zone_t *rpz, isc_ht_t *newnodes) {
result = dns_dbiterator_first(updbit); result = dns_dbiterator_first(updbit);
if (result != ISC_R_SUCCESS && result != ISC_R_NOMORE) { if (result != ISC_R_SUCCESS && result != ISC_R_NOMORE) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, ISC_LOG_ERROR,
"rpz: %s: failed to get db iterator - %s", domain, "rpz: %s: failed to get db iterator - %s", domain,
isc_result_totext(result)); isc_result_totext(result));
goto cleanup; goto cleanup;
@ -1793,7 +1790,7 @@ update_nodes(dns_rpz_zone_t *rpz, isc_ht_t *newnodes) {
result = dns_dbiterator_current(updbit, &node, name); result = dns_dbiterator_current(updbit, &node, name);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, DNS_LOGMODULE_MASTER, ISC_LOG_ERROR,
"rpz: %s: failed to get dbiterator - %s", "rpz: %s: failed to get dbiterator - %s",
domain, isc_result_totext(result)); domain, isc_result_totext(result));
@ -1806,7 +1803,7 @@ update_nodes(dns_rpz_zone_t *rpz, isc_ht_t *newnodes) {
result = dns_db_allrdatasets(rpz->updb, node, rpz->updbversion, result = dns_db_allrdatasets(rpz->updb, node, rpz->updbversion,
0, 0, &rdsiter); 0, 0, &rdsiter);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, DNS_LOGMODULE_MASTER, ISC_LOG_ERROR,
"rpz: %s: failed to fetch " "rpz: %s: failed to fetch "
"rrdatasets - %s", "rrdatasets - %s",
@ -1823,7 +1820,7 @@ update_nodes(dns_rpz_zone_t *rpz, isc_ht_t *newnodes) {
if (result != ISC_R_SUCCESS) { /* skip empty non-terminal */ if (result != ISC_R_SUCCESS) { /* skip empty non-terminal */
if (result != ISC_R_NOMORE) { if (result != ISC_R_NOMORE) {
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, DNS_LOGMODULE_MASTER, ISC_LOG_ERROR,
"rpz: %s: error %s while creating " "rpz: %s: error %s while creating "
"rdatasetiter", "rdatasetiter",
@ -1838,7 +1835,7 @@ update_nodes(dns_rpz_zone_t *rpz, isc_ht_t *newnodes) {
result = isc_ht_add(newnodes, name->ndata, name->length, rpz); result = isc_ht_add(newnodes, name->ndata, name->length, rpz);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
dns_name_format(name, namebuf, sizeof(namebuf)); dns_name_format(name, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, DNS_LOGMODULE_MASTER, ISC_LOG_ERROR,
"rpz: %s, adding node %s to HT error %s", "rpz: %s, adding node %s to HT error %s",
domain, namebuf, domain, namebuf,
@ -1865,15 +1862,15 @@ update_nodes(dns_rpz_zone_t *rpz, isc_ht_t *newnodes) {
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
dns_name_format(name, namebuf, sizeof(namebuf)); dns_name_format(name, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_ERROR, DNS_LOGMODULE_MASTER, ISC_LOG_ERROR,
"rpz: %s: adding node %s " "rpz: %s: adding node %s "
"to RPZ error %s", "to RPZ error %s",
domain, namebuf, domain, namebuf,
isc_result_totext(result)); isc_result_totext(result));
} else if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) { } else if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
dns_name_format(name, namebuf, sizeof(namebuf)); dns_name_format(name, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_DEBUG(3), DNS_LOGMODULE_MASTER, ISC_LOG_DEBUG(3),
"rpz: %s: adding node %s", domain, "rpz: %s: adding node %s", domain,
namebuf); namebuf);
@ -2011,7 +2008,7 @@ dns__rpz_timer_cb(void *arg) {
rpz->dbversion = NULL; rpz->dbversion = NULL;
dns_name_format(&rpz->origin, domain, DNS_NAME_FORMATSIZE); dns_name_format(&rpz->origin, domain, DNS_NAME_FORMATSIZE);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
ISC_LOG_INFO, "rpz: %s: reload start", domain); ISC_LOG_INFO, "rpz: %s: reload start", domain);
dns_rpz_zones_ref(rpz->rpzs); dns_rpz_zones_ref(rpz->rpzs);
@ -2363,8 +2360,8 @@ del_name(dns_rpz_zone_t *rpz, dns_rpz_type_t rpz_type,
* "rpz.*failed". * "rpz.*failed".
*/ */
dns_name_format(src_name, namebuf, sizeof(namebuf)); dns_name_format(src_name, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_LOGMODULE_RBTDB, DNS_RPZ_ERROR_LEVEL, DNS_RPZ_ERROR_LEVEL,
"rpz del_name(%s) node delete " "rpz del_name(%s) node delete "
"failed: %s", "failed: %s",
namebuf, isc_result_totext(result)); namebuf, isc_result_totext(result));
@ -2528,9 +2525,8 @@ dns_rpz_find_ip(dns_rpz_zones_t *rpzs, dns_rpz_type_t rpz_type,
/* /*
* bin/tests/system/rpz/tests.sh looks for "rpz.*failed". * bin/tests/system/rpz/tests.sh looks for "rpz.*failed".
*/ */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_LOGMODULE_RBTDB, DNS_RPZ_ERROR_LEVEL, DNS_RPZ_ERROR_LEVEL, "rpz ip2name() failed: %s",
"rpz ip2name() failed: %s",
isc_result_totext(result)); isc_result_totext(result));
return (DNS_RPZ_INVALID_NUM); return (DNS_RPZ_INVALID_NUM);
} }
@ -2592,8 +2588,8 @@ dns_rpz_find_name(dns_rpz_zones_t *rpzs, dns_rpz_type_t rpz_type,
* bin/tests/system/rpz/tests.sh looks for "rpz.*failed". * bin/tests/system/rpz/tests.sh looks for "rpz.*failed".
*/ */
dns_name_format(trig_name, namebuf, sizeof(namebuf)); dns_name_format(trig_name, namebuf, sizeof(namebuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, isc_log_write(DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
DNS_LOGMODULE_RBTDB, DNS_RPZ_ERROR_LEVEL, DNS_RPZ_ERROR_LEVEL,
"dns_rpz_find_name(%s) failed: %s", namebuf, "dns_rpz_find_name(%s) failed: %s", namebuf,
isc_result_totext(result)); isc_result_totext(result));
break; break;

View File

@ -101,9 +101,9 @@ hash_divisor(unsigned int initial) {
} }
} while (pp < &primes[sizeof(primes) / sizeof(primes[0])]); } while (pp < &primes[sizeof(primes) / sizeof(primes[0])]);
if (isc_log_wouldlog(dns_lctx, DNS_RRL_LOG_DEBUG3)) { if (isc_log_wouldlog(DNS_RRL_LOG_DEBUG3)) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RRL, isc_log_write(DNS_LOGCATEGORY_RRL, DNS_LOGMODULE_REQUEST,
DNS_LOGMODULE_REQUEST, DNS_RRL_LOG_DEBUG3, DNS_RRL_LOG_DEBUG3,
"%d hash_divisor() divisions in %d tries" "%d hash_divisor() divisions in %d tries"
" to get %d from %d", " to get %d from %d",
divisions, tries, result, initial); divisions, tries, result, initial);
@ -184,8 +184,8 @@ set_age(dns_rrl_t *rrl, dns_rrl_entry_t *e, isc_stdtime_t now) {
} }
if (i != 0) { if (i != 0) {
isc_log_write( isc_log_write(
dns_lctx, DNS_LOGCATEGORY_RRL, DNS_LOGCATEGORY_RRL, DNS_LOGMODULE_REQUEST,
DNS_LOGMODULE_REQUEST, DNS_RRL_LOG_DEBUG1, DNS_RRL_LOG_DEBUG1,
"rrl new time base scanned %d entries" "rrl new time base scanned %d entries"
" at %d for %d %d %d %d", " at %d for %d %d %d %d",
i, now, rrl->ts_bases[ts_gen], i, now, rrl->ts_bases[ts_gen],
@ -224,13 +224,13 @@ expand_entries(dns_rrl_t *rrl, int newsize) {
* Log expansions so that the user can tune max-table-size * Log expansions so that the user can tune max-table-size
* and min-table-size. * and min-table-size.
*/ */
if (isc_log_wouldlog(dns_lctx, DNS_RRL_LOG_DROP) && rrl->hash != NULL) { if (isc_log_wouldlog(DNS_RRL_LOG_DROP) && rrl->hash != NULL) {
rate = rrl->probes; rate = rrl->probes;
if (rrl->searches != 0) { if (rrl->searches != 0) {
rate /= rrl->searches; rate /= rrl->searches;
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RRL, isc_log_write(DNS_LOGCATEGORY_RRL, DNS_LOGMODULE_REQUEST,
DNS_LOGMODULE_REQUEST, DNS_RRL_LOG_DROP, DNS_RRL_LOG_DROP,
"increase from %d to %d RRL entries with" "increase from %d to %d RRL entries with"
" %d bins; average search length %.1f", " %d bins; average search length %.1f",
rrl->num_entries, rrl->num_entries + newsize, rrl->num_entries, rrl->num_entries + newsize,
@ -310,13 +310,13 @@ expand_rrl_hash(dns_rrl_t *rrl, isc_stdtime_t now) {
rrl->hash_gen ^= 1; rrl->hash_gen ^= 1;
hash->gen = rrl->hash_gen; hash->gen = rrl->hash_gen;
if (isc_log_wouldlog(dns_lctx, DNS_RRL_LOG_DROP) && old_bins != 0) { if (isc_log_wouldlog(DNS_RRL_LOG_DROP) && old_bins != 0) {
rate = rrl->probes; rate = rrl->probes;
if (rrl->searches != 0) { if (rrl->searches != 0) {
rate /= rrl->searches; rate /= rrl->searches;
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RRL, isc_log_write(DNS_LOGCATEGORY_RRL, DNS_LOGMODULE_REQUEST,
DNS_LOGMODULE_REQUEST, DNS_RRL_LOG_DROP, DNS_RRL_LOG_DROP,
"increase from %d to %d RRL bins for" "increase from %d to %d RRL bins for"
" %d entries; average search length %.1f", " %d entries; average search length %.1f",
old_bins, new_bins, rrl->num_entries, rate); old_bins, new_bins, rrl->num_entries, rate);
@ -619,7 +619,7 @@ debit_log(const dns_rrl_entry_t *e, int age, const char *action) {
snprintf(buf, sizeof(buf), "age=%d", age); snprintf(buf, sizeof(buf), "age=%d", age);
age_str = buf; age_str = buf;
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RRL, DNS_LOGMODULE_REQUEST, isc_log_write(DNS_LOGCATEGORY_RRL, DNS_LOGMODULE_REQUEST,
DNS_RRL_LOG_DEBUG3, "rrl %08x %6s responses=%-3d %s", DNS_RRL_LOG_DEBUG3, "rrl %08x %6s responses=%-3d %s",
hash_key(&e->key), age_str, e->responses, action); hash_key(&e->key), age_str, e->responses, action);
} }
@ -662,7 +662,7 @@ debit_rrl_entry(dns_rrl_t *rrl, dns_rrl_entry_t *e, double qps, double scale,
new_rate = 1; new_rate = 1;
} }
if (ratep->scaled != new_rate) { if (ratep->scaled != new_rate) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RRL, isc_log_write(DNS_LOGCATEGORY_RRL,
DNS_LOGMODULE_REQUEST, DNS_RRL_LOG_DEBUG1, DNS_LOGMODULE_REQUEST, DNS_RRL_LOG_DEBUG1,
"%d qps scaled %s by %.2f" "%d qps scaled %s by %.2f"
" from %d to %d", " from %d to %d",
@ -718,7 +718,7 @@ debit_rrl_entry(dns_rrl_t *rrl, dns_rrl_entry_t *e, double qps, double scale,
* Debit the entry for this response. * Debit the entry for this response.
*/ */
if (--e->responses >= 0) { if (--e->responses >= 0) {
if (isc_log_wouldlog(dns_lctx, DNS_RRL_LOG_DEBUG3)) { if (isc_log_wouldlog(DNS_RRL_LOG_DEBUG3)) {
debit_log(e, age, ""); debit_log(e, age, "");
} }
return (DNS_RRL_RESULT_OK); return (DNS_RRL_RESULT_OK);
@ -738,7 +738,7 @@ debit_rrl_entry(dns_rrl_t *rrl, dns_rrl_entry_t *e, double qps, double scale,
new_slip = 2; new_slip = 2;
} }
if (rrl->slip.scaled != new_slip) { if (rrl->slip.scaled != new_slip) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RRL, isc_log_write(DNS_LOGCATEGORY_RRL,
DNS_LOGMODULE_REQUEST, DNS_RRL_LOG_DEBUG1, DNS_LOGMODULE_REQUEST, DNS_RRL_LOG_DEBUG1,
"%d qps scaled slip" "%d qps scaled slip"
" by %.2f from %d to %d", " by %.2f from %d to %d",
@ -752,7 +752,7 @@ debit_rrl_entry(dns_rrl_t *rrl, dns_rrl_entry_t *e, double qps, double scale,
if ((int)e->slip_cnt >= slip) { if ((int)e->slip_cnt >= slip) {
e->slip_cnt = 0; e->slip_cnt = 0;
} }
if (isc_log_wouldlog(dns_lctx, DNS_RRL_LOG_DEBUG3)) { if (isc_log_wouldlog(DNS_RRL_LOG_DEBUG3)) {
debit_log(e, age, "slip"); debit_log(e, age, "slip");
} }
return (DNS_RRL_RESULT_SLIP); return (DNS_RRL_RESULT_SLIP);
@ -761,7 +761,7 @@ debit_rrl_entry(dns_rrl_t *rrl, dns_rrl_entry_t *e, double qps, double scale,
} }
} }
if (isc_log_wouldlog(dns_lctx, DNS_RRL_LOG_DEBUG3)) { if (isc_log_wouldlog(DNS_RRL_LOG_DEBUG3)) {
debit_log(e, age, "drop"); debit_log(e, age, "drop");
} }
return (DNS_RRL_RESULT_DROP); return (DNS_RRL_RESULT_DROP);
@ -970,9 +970,8 @@ log_end(dns_rrl_t *rrl, dns_rrl_entry_t *e, bool early, char *log_buf,
: "stop limiting ", : "stop limiting ",
true, NULL, false, DNS_RRL_RESULT_OK, true, NULL, false, DNS_RRL_RESULT_OK,
ISC_R_SUCCESS, log_buf, log_buf_len); ISC_R_SUCCESS, log_buf, log_buf_len);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RRL, isc_log_write(DNS_LOGCATEGORY_RRL, DNS_LOGMODULE_REQUEST,
DNS_LOGMODULE_REQUEST, DNS_RRL_LOG_DROP, "%s", DNS_RRL_LOG_DROP, "%s", log_buf);
log_buf);
free_qname(rrl, e); free_qname(rrl, e);
e->logged = false; e->logged = false;
--rrl->num_logged; --rrl->num_logged;
@ -1067,11 +1066,8 @@ dns_rrl(dns_view_t *view, dns_zone_t *zone, const isc_sockaddr_t *client_addr,
} else { } else {
qps = (1.0 * rrl->qps_responses) / secs; qps = (1.0 * rrl->qps_responses) / secs;
if (secs >= rrl->window) { if (secs >= rrl->window) {
if (isc_log_wouldlog(dns_lctx, if (isc_log_wouldlog(DNS_RRL_LOG_DEBUG3)) {
DNS_RRL_LOG_DEBUG3)) isc_log_write(DNS_LOGCATEGORY_RRL,
{
isc_log_write(dns_lctx,
DNS_LOGCATEGORY_RRL,
DNS_LOGMODULE_REQUEST, DNS_LOGMODULE_REQUEST,
DNS_RRL_LOG_DEBUG3, DNS_RRL_LOG_DEBUG3,
"%d responses/%d seconds" "%d responses/%d seconds"
@ -1143,7 +1139,7 @@ dns_rrl(dns_view_t *view, dns_zone_t *zone, const isc_sockaddr_t *client_addr,
return (DNS_RRL_RESULT_OK); return (DNS_RRL_RESULT_OK);
} }
if (isc_log_wouldlog(dns_lctx, DNS_RRL_LOG_DEBUG1)) { if (isc_log_wouldlog(DNS_RRL_LOG_DEBUG1)) {
/* /*
* Do not worry about speed or releasing the lock. * Do not worry about speed or releasing the lock.
* This message appears before messages from debit_rrl_entry(). * This message appears before messages from debit_rrl_entry().
@ -1151,9 +1147,8 @@ dns_rrl(dns_view_t *view, dns_zone_t *zone, const isc_sockaddr_t *client_addr,
make_log_buf(rrl, e, "consider limiting ", NULL, false, qname, make_log_buf(rrl, e, "consider limiting ", NULL, false, qname,
false, DNS_RRL_RESULT_OK, resp_result, log_buf, false, DNS_RRL_RESULT_OK, resp_result, log_buf,
log_buf_len); log_buf_len);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RRL, isc_log_write(DNS_LOGCATEGORY_RRL, DNS_LOGMODULE_REQUEST,
DNS_LOGMODULE_REQUEST, DNS_RRL_LOG_DEBUG1, "%s", DNS_RRL_LOG_DEBUG1, "%s", log_buf);
log_buf);
} }
rrl_result = debit_rrl_entry(rrl, e, qps, scale, client_addr, now, rrl_result = debit_rrl_entry(rrl, e, qps, scale, client_addr, now,
@ -1184,13 +1179,13 @@ dns_rrl(dns_view_t *view, dns_zone_t *zone, const isc_sockaddr_t *client_addr,
if (rrl_all_result != DNS_RRL_RESULT_OK) { if (rrl_all_result != DNS_RRL_RESULT_OK) {
e = e_all; e = e_all;
rrl_result = rrl_all_result; rrl_result = rrl_all_result;
if (isc_log_wouldlog(dns_lctx, DNS_RRL_LOG_DEBUG1)) { if (isc_log_wouldlog(DNS_RRL_LOG_DEBUG1)) {
make_log_buf(rrl, e, make_log_buf(rrl, e,
"prefer all-per-second limiting ", "prefer all-per-second limiting ",
NULL, true, qname, false, NULL, true, qname, false,
DNS_RRL_RESULT_OK, resp_result, DNS_RRL_RESULT_OK, resp_result,
log_buf, log_buf_len); log_buf, log_buf_len);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RRL, isc_log_write(DNS_LOGCATEGORY_RRL,
DNS_LOGMODULE_REQUEST, DNS_LOGMODULE_REQUEST,
DNS_RRL_LOG_DEBUG1, "%s", DNS_RRL_LOG_DEBUG1, "%s",
log_buf); log_buf);
@ -1207,7 +1202,7 @@ dns_rrl(dns_view_t *view, dns_zone_t *zone, const isc_sockaddr_t *client_addr,
* Log occasionally in the rate-limit category. * Log occasionally in the rate-limit category.
*/ */
if ((!e->logged || e->log_secs >= DNS_RRL_MAX_LOG_SECS) && if ((!e->logged || e->log_secs >= DNS_RRL_MAX_LOG_SECS) &&
isc_log_wouldlog(dns_lctx, DNS_RRL_LOG_DROP)) isc_log_wouldlog(DNS_RRL_LOG_DROP))
{ {
make_log_buf(rrl, e, rrl->log_only ? "would " : NULL, make_log_buf(rrl, e, rrl->log_only ? "would " : NULL,
e->logged ? "continue limiting " : "limit ", true, e->logged ? "continue limiting " : "limit ", true,
@ -1228,9 +1223,8 @@ dns_rrl(dns_view_t *view, dns_zone_t *zone, const isc_sockaddr_t *client_addr,
UNLOCK(&rrl->lock); UNLOCK(&rrl->lock);
e = NULL; e = NULL;
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RRL, isc_log_write(DNS_LOGCATEGORY_RRL, DNS_LOGMODULE_REQUEST,
DNS_LOGMODULE_REQUEST, DNS_RRL_LOG_DROP, "%s", DNS_RRL_LOG_DROP, "%s", log_buf);
log_buf);
} }
/* /*

View File

@ -229,7 +229,7 @@ static void
sdlz_log(int level, const char *fmt, ...) { sdlz_log(int level, const char *fmt, ...) {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, isc_log_vwrite(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ,
ISC_LOG_DEBUG(level), fmt, ap); ISC_LOG_DEBUG(level), fmt, ap);
va_end(ap); va_end(ap);
} }

View File

@ -373,8 +373,7 @@ dns_ssutable_checkrules(dns_ssutable_t *table, const dns_name_t *signer,
rcu_read_unlock(); rcu_read_unlock();
if (match == 0) { if (match == 0) {
if (signer != NULL) { if (signer != NULL) {
isc_log_write(dns_lctx, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_SSU, DNS_LOGMODULE_SSU,
ISC_LOG_WARNING, ISC_LOG_WARNING,
"update-policy local: " "update-policy local: "

View File

@ -45,7 +45,7 @@ ssu_e_log(int level, const char *fmt, ...) {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_SECURITY, DNS_LOGMODULE_ZONE, isc_log_vwrite(DNS_LOGCATEGORY_SECURITY, DNS_LOGMODULE_ZONE,
ISC_LOG_DEBUG(level), fmt, ap); ISC_LOG_DEBUG(level), fmt, ap);
va_end(ap); va_end(ap);
} }

View File

@ -70,7 +70,7 @@ tkey_log(const char *fmt, ...) {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_REQUEST, isc_log_vwrite(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_REQUEST,
ISC_LOG_DEBUG(4), fmt, ap); ISC_LOG_DEBUG(4), fmt, ap);
va_end(ap); va_end(ap);
} }

View File

@ -124,7 +124,7 @@ tsig_log(dns_tsigkey_t *key, int level, const char *fmt, ...) {
char namestr[DNS_NAME_FORMATSIZE]; char namestr[DNS_NAME_FORMATSIZE];
char creatorstr[DNS_NAME_FORMATSIZE]; char creatorstr[DNS_NAME_FORMATSIZE];
if (!isc_log_wouldlog(dns_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
if (key != NULL) { if (key != NULL) {
@ -143,14 +143,12 @@ tsig_log(dns_tsigkey_t *key, int level, const char *fmt, ...) {
vsnprintf(message, sizeof(message), fmt, ap); vsnprintf(message, sizeof(message), fmt, ap);
va_end(ap); va_end(ap);
if (key != NULL && key->generated) { if (key != NULL && key->generated) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_TSIG, level,
DNS_LOGMODULE_TSIG, level,
"tsig key '%s' (%s): %s", namestr, creatorstr, "tsig key '%s' (%s): %s", namestr, creatorstr,
message); message);
} else { } else {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_TSIG, level,
DNS_LOGMODULE_TSIG, level, "tsig key '%s': %s", "tsig key '%s': %s", namestr, message);
namestr, message);
} }
} }
@ -286,8 +284,8 @@ dns_tsigkey_createfromkey(const dns_name_t *name, dst_algorithm_t algorithm,
{ {
char namestr[DNS_NAME_FORMATSIZE]; char namestr[DNS_NAME_FORMATSIZE];
dns_name_format(name, namestr, sizeof(namestr)); dns_name_format(name, namestr, sizeof(namestr));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_TSIG,
DNS_LOGMODULE_TSIG, ISC_LOG_INFO, ISC_LOG_INFO,
"the key '%s' is too short to be secure", "the key '%s' is too short to be secure",
namestr); namestr);
} }

View File

@ -131,7 +131,7 @@
case DNS_R_NXRRSET: \ case DNS_R_NXRRSET: \
_what = "unsuccessful"; \ _what = "unsuccessful"; \
} \ } \
if (isc_log_wouldlog(dns_lctx, LOGLEVEL_PROTOCOL)) { \ if (isc_log_wouldlog(LOGLEVEL_PROTOCOL)) { \
char _nbuf[DNS_NAME_FORMATSIZE]; \ char _nbuf[DNS_NAME_FORMATSIZE]; \
dns_name_format(name, _nbuf, sizeof(_nbuf)); \ dns_name_format(name, _nbuf, sizeof(_nbuf)); \
update_log(log, zone, LOGLEVEL_PROTOCOL, \ update_log(log, zone, LOGLEVEL_PROTOCOL, \
@ -153,7 +153,7 @@
case DNS_R_NXRRSET: \ case DNS_R_NXRRSET: \
_what = "unsuccessful"; \ _what = "unsuccessful"; \
} \ } \
if (isc_log_wouldlog(dns_lctx, LOGLEVEL_PROTOCOL)) { \ if (isc_log_wouldlog(LOGLEVEL_PROTOCOL)) { \
char _nbuf[DNS_NAME_FORMATSIZE]; \ char _nbuf[DNS_NAME_FORMATSIZE]; \
char _tbuf[DNS_RDATATYPE_FORMATSIZE]; \ char _tbuf[DNS_RDATATYPE_FORMATSIZE]; \
dns_name_format(name, _nbuf, sizeof(_nbuf)); \ dns_name_format(name, _nbuf, sizeof(_nbuf)); \
@ -208,7 +208,7 @@ update_log(dns_update_log_t *callback, dns_zone_t *zone, int level,
return; return;
} }
if (!isc_log_wouldlog(dns_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }

View File

@ -3540,11 +3540,11 @@ validator_logv(dns_validator_t *val, isc_logcategory_t *category,
dns_name_format(val->name, namebuf, sizeof(namebuf)); dns_name_format(val->name, namebuf, sizeof(namebuf));
dns_rdatatype_format(val->type, typebuf, sizeof(typebuf)); dns_rdatatype_format(val->type, typebuf, sizeof(typebuf));
isc_log_write(dns_lctx, category, module, level, isc_log_write(category, module, level,
"%s%s%s%.*svalidating %s/%s: %s", sep1, viewname, "%s%s%s%.*svalidating %s/%s: %s", sep1, viewname,
sep2, depth, spaces, namebuf, typebuf, msgbuf); sep2, depth, spaces, namebuf, typebuf, msgbuf);
} else { } else {
isc_log_write(dns_lctx, category, module, level, isc_log_write(category, module, level,
"%s%s%s%.*svalidator @%p: %s", sep1, viewname, "%s%s%s%.*svalidator @%p: %s", sep1, viewname,
sep2, depth, spaces, val, msgbuf); sep2, depth, spaces, val, msgbuf);
} }
@ -3554,7 +3554,7 @@ static void
validator_log(void *val, int level, const char *fmt, ...) { validator_log(void *val, int level, const char *fmt, ...) {
va_list ap; va_list ap;
if (!isc_log_wouldlog(dns_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }

View File

@ -1864,9 +1864,8 @@ dns_view_setnewzones(dns_view_t *view, bool allow, void *cfgctx,
status = mdb_env_create(&env); status = mdb_env_create(&env);
if (status != MDB_SUCCESS) { if (status != MDB_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, ISC_LOGMODULE_OTHER,
ISC_LOGMODULE_OTHER, ISC_LOG_ERROR, ISC_LOG_ERROR, "mdb_env_create failed: %s",
"mdb_env_create failed: %s",
mdb_strerror(status)); mdb_strerror(status));
CHECK(ISC_R_FAILURE); CHECK(ISC_R_FAILURE);
} }
@ -1874,7 +1873,7 @@ dns_view_setnewzones(dns_view_t *view, bool allow, void *cfgctx,
if (mapsize != 0ULL) { if (mapsize != 0ULL) {
status = mdb_env_set_mapsize(env, mapsize); status = mdb_env_set_mapsize(env, mapsize);
if (status != MDB_SUCCESS) { if (status != MDB_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_OTHER, ISC_LOG_ERROR, ISC_LOGMODULE_OTHER, ISC_LOG_ERROR,
"mdb_env_set_mapsize failed: %s", "mdb_env_set_mapsize failed: %s",
mdb_strerror(status)); mdb_strerror(status));
@ -1885,9 +1884,8 @@ dns_view_setnewzones(dns_view_t *view, bool allow, void *cfgctx,
status = mdb_env_open(env, view->new_zone_db, DNS_LMDB_FLAGS, 0600); status = mdb_env_open(env, view->new_zone_db, DNS_LMDB_FLAGS, 0600);
if (status != MDB_SUCCESS) { if (status != MDB_SUCCESS) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, ISC_LOGMODULE_OTHER,
ISC_LOGMODULE_OTHER, ISC_LOG_ERROR, ISC_LOG_ERROR, "mdb_env_open of '%s' failed: %s",
"mdb_env_open of '%s' failed: %s",
view->new_zone_db, mdb_strerror(status)); view->new_zone_db, mdb_strerror(status));
CHECK(ISC_R_FAILURE); CHECK(ISC_R_FAILURE);
} }
@ -2184,8 +2182,8 @@ dns_view_loadnta(dns_view_t *view) {
} else { } else {
char nb[DNS_NAME_FORMATSIZE]; char nb[DNS_NAME_FORMATSIZE];
dns_name_format(ntaname, nb, sizeof(nb)); dns_name_format(ntaname, nb, sizeof(nb));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC, isc_log_write(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_NTA,
DNS_LOGMODULE_NTA, ISC_LOG_INFO, ISC_LOG_INFO,
"ignoring expired NTA at %s", nb); "ignoring expired NTA at %s", nb);
} }
} }

View File

@ -2121,7 +2121,7 @@ xfrin_log(dns_xfrin_t *xfr, int level, const char *fmt, ...) {
char primarytext[ISC_SOCKADDR_FORMATSIZE]; char primarytext[ISC_SOCKADDR_FORMATSIZE];
char msgtext[2048]; char msgtext[2048];
if (!isc_log_wouldlog(dns_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
@ -2131,7 +2131,7 @@ xfrin_log(dns_xfrin_t *xfr, int level, const char *fmt, ...) {
vsnprintf(msgtext, sizeof(msgtext), fmt, ap); vsnprintf(msgtext, sizeof(msgtext), fmt, ap);
va_end(ap); va_end(ap);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_XFER_IN, DNS_LOGMODULE_XFER_IN, isc_log_write(DNS_LOGCATEGORY_XFER_IN, DNS_LOGMODULE_XFER_IN, level,
level, "%p: transfer of '%s' from %s: %s", xfr, xfr->info, "%p: transfer of '%s' from %s: %s", xfr, xfr->info,
primarytext, msgtext); primarytext, msgtext);
} }

View File

@ -4873,7 +4873,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
if (remove(zone->journal) < 0 && errno != ENOENT) { if (remove(zone->journal) < 0 && errno != ENOENT) {
char strbuf[ISC_STRERRORSIZE]; char strbuf[ISC_STRERRORSIZE];
strerror_r(errno, strbuf, sizeof(strbuf)); strerror_r(errno, strbuf, sizeof(strbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_ZONE, DNS_LOGMODULE_ZONE,
ISC_LOG_WARNING, ISC_LOG_WARNING,
"unable to remove journal " "unable to remove journal "
@ -6203,7 +6203,7 @@ findzonekeys(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *ver,
algbuf, dst_key_id(pubkey)); algbuf, dst_key_id(pubkey));
} }
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING, DNS_LOGMODULE_DNSSEC, ISC_LOG_WARNING,
"dns_zone_findkeys: error reading %s: %s", "dns_zone_findkeys: error reading %s: %s",
filename, isc_result_totext(result)); filename, isc_result_totext(result));
@ -10918,7 +10918,7 @@ zone_refreshkeys(dns_zone_t *zone) {
dns_rdataset_clone(kdset, &kfetch->keydataset); dns_rdataset_clone(kdset, &kfetch->keydataset);
dns_db_attach(db, &kfetch->db); dns_db_attach(db, &kfetch->db);
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
char namebuf[DNS_NAME_FORMATSIZE]; char namebuf[DNS_NAME_FORMATSIZE];
dns_name_format(kname, namebuf, dns_name_format(kname, namebuf,
sizeof(namebuf)); sizeof(namebuf));
@ -15740,7 +15740,7 @@ dns_zone_logv(dns_zone_t *zone, isc_logcategory_t *category, int level,
REQUIRE(DNS_ZONE_VALID(zone)); REQUIRE(DNS_ZONE_VALID(zone));
if (!isc_log_wouldlog(dns_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
@ -15757,8 +15757,8 @@ dns_zone_logv(dns_zone_t *zone, isc_logcategory_t *category, int level,
zstr = "zone "; zstr = "zone ";
} }
isc_log_write(dns_lctx, category, DNS_LOGMODULE_ZONE, level, isc_log_write(category, DNS_LOGMODULE_ZONE, level, "%s%s%s%s: %s",
"%s%s%s%s: %s", (prefix != NULL ? prefix : ""), (prefix != NULL ? prefix : ""),
(prefix != NULL ? ": " : ""), zstr, zone->strnamerd, (prefix != NULL ? ": " : ""), zstr, zone->strnamerd,
message); message);
} }
@ -16950,8 +16950,8 @@ save_nsec3param(dns_zone_t *zone, nsec3paramlist_t *nsec3list) {
dns_rdata_t private = DNS_RDATA_INIT; dns_rdata_t private = DNS_RDATA_INIT;
dns_rdataset_current(&rdataset, &rdata); dns_rdataset_current(&rdataset, &rdata);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_ZONE,
DNS_LOGMODULE_ZONE, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3),
"looping through nsec3param data"); "looping through nsec3param data");
nsec3param = isc_mem_get(zone->mctx, sizeof(nsec3param_t)); nsec3param = isc_mem_get(zone->mctx, sizeof(nsec3param_t));
ISC_LINK_INIT(nsec3param, link); ISC_LINK_INIT(nsec3param, link);
@ -16986,8 +16986,8 @@ getprivate:
dns_rdata_t private = DNS_RDATA_INIT; dns_rdata_t private = DNS_RDATA_INIT;
dns_rdataset_current(&prdataset, &private); dns_rdataset_current(&prdataset, &private);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_ZONE,
DNS_LOGMODULE_ZONE, ISC_LOG_DEBUG(3), ISC_LOG_DEBUG(3),
"looping through nsec3param private data"); "looping through nsec3param private data");
/* /*
@ -17482,7 +17482,7 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, bool dump) {
{ {
char strbuf[ISC_STRERRORSIZE]; char strbuf[ISC_STRERRORSIZE];
strerror_r(errno, strbuf, sizeof(strbuf)); strerror_r(errno, strbuf, sizeof(strbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_ZONE, DNS_LOGMODULE_ZONE,
ISC_LOG_WARNING, ISC_LOG_WARNING,
"unable to remove masterfile " "unable to remove masterfile "
@ -17507,13 +17507,13 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, bool dump) {
* up-to-date, it is useless and should be * up-to-date, it is useless and should be
* removed. * removed.
*/ */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_ZONE, ISC_LOG_DEBUG(3), DNS_LOGMODULE_ZONE, ISC_LOG_DEBUG(3),
"removing journal file"); "removing journal file");
if (remove(zone->journal) < 0 && errno != ENOENT) { if (remove(zone->journal) < 0 && errno != ENOENT) {
char strbuf[ISC_STRERRORSIZE]; char strbuf[ISC_STRERRORSIZE];
strerror_r(errno, strbuf, sizeof(strbuf)); strerror_r(errno, strbuf, sizeof(strbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, isc_log_write(DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_ZONE, DNS_LOGMODULE_ZONE,
ISC_LOG_WARNING, ISC_LOG_WARNING,
"unable to remove journal " "unable to remove journal "
@ -20568,8 +20568,8 @@ static void
dnssec_report(const char *format, ...) { dnssec_report(const char *format, ...) {
va_list args; va_list args;
va_start(args, format); va_start(args, format);
isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_ZONE, isc_log_vwrite(DNS_LOGCATEGORY_DNSSEC, DNS_LOGMODULE_ZONE, ISC_LOG_INFO,
ISC_LOG_INFO, format, args); format, args);
va_end(args); va_end(args);
} }
@ -21579,7 +21579,7 @@ nsfetch_done(void *arg) {
break; break;
} }
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
char nsnamebuf[DNS_NAME_FORMATSIZE]; char nsnamebuf[DNS_NAME_FORMATSIZE];
dns_name_format(&ns.name, nsnamebuf, sizeof(nsnamebuf)); dns_name_format(&ns.name, nsnamebuf, sizeof(nsnamebuf));
dns_zone_log(zone, ISC_LOG_DEBUG(3), dns_zone_log(zone, ISC_LOG_DEBUG(3),
@ -21656,7 +21656,7 @@ do_nsfetch(void *arg) {
goto cleanup; goto cleanup;
} }
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
char namebuf[DNS_NAME_FORMATSIZE]; char namebuf[DNS_NAME_FORMATSIZE];
dns_name_format(&nsfetch->pname, namebuf, sizeof(namebuf)); dns_name_format(&nsfetch->pname, namebuf, sizeof(namebuf));
dnssec_log(zone, ISC_LOG_WARNING, dnssec_log(zone, ISC_LOG_WARNING,
@ -21727,7 +21727,7 @@ nsfetch_levelup(dns_nsfetch_t *nsfetch) {
dns_rdataset_init(&nsfetch->nsrrset); dns_rdataset_init(&nsfetch->nsrrset);
dns_rdataset_init(&nsfetch->nssigset); dns_rdataset_init(&nsfetch->nssigset);
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
dnssec_log(zone, ISC_LOG_DEBUG(3), dnssec_log(zone, ISC_LOG_DEBUG(3),
"Creating parent NS fetch in " "Creating parent NS fetch in "
"nsfetch_levelup()"); "nsfetch_levelup()");
@ -21809,7 +21809,7 @@ zone_checkds(dns_zone_t *zone) {
dns_name_dup(&zone->origin, zone->mctx, name); dns_name_dup(&zone->origin, zone->mctx, name);
dns_rdataset_init(&nsfetch->nsrrset); dns_rdataset_init(&nsfetch->nsrrset);
dns_rdataset_init(&nsfetch->nssigset); dns_rdataset_init(&nsfetch->nssigset);
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
dnssec_log( dnssec_log(
zone, ISC_LOG_DEBUG(3), zone, ISC_LOG_DEBUG(3),
"Creating parent NS fetch in zone_checkds()"); "Creating parent NS fetch in zone_checkds()");
@ -22502,7 +22502,7 @@ zone_rekey(dns_zone_t *zone) {
} }
UNLOCK_ZONE(zone); UNLOCK_ZONE(zone);
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
for (key = ISC_LIST_HEAD(dnskeys); key != NULL; for (key = ISC_LIST_HEAD(dnskeys); key != NULL;
key = ISC_LIST_NEXT(key, link)) key = ISC_LIST_NEXT(key, link))
{ {
@ -23798,7 +23798,7 @@ dns_zone_setnsec3param(dns_zone_t *zone, uint8_t hash, uint8_t flags,
np->rdata = param; np->rdata = param;
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(3))) {
unsigned char salttext[255 * 2 + 1]; unsigned char salttext[255 * 2 + 1];
if (param.salt != NULL) { if (param.salt != NULL) {
salt2text(param.salt, param.salt_length, salt2text(param.salt, param.salt_length,

View File

@ -466,8 +466,8 @@ freezezones(dns_zone_t *zone, void *uap) {
sizeof(classstr)); sizeof(classstr));
dns_name_format(dns_zone_getorigin(zone), zonename, sizeof(zonename)); dns_name_format(dns_zone_getorigin(zone), zonename, sizeof(zonename));
level = (result != ISC_R_SUCCESS) ? ISC_LOG_ERROR : ISC_LOG_DEBUG(1); level = (result != ISC_R_SUCCESS) ? ISC_LOG_ERROR : ISC_LOG_DEBUG(1);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_ZONE, isc_log_write(DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_ZONE, level,
level, "%s zone '%s/%s'%s%s: %s", "%s zone '%s/%s'%s%s: %s",
params->freeze ? "freezing" : "thawing", zonename, params->freeze ? "freezing" : "thawing", zonename,
classstr, sep, vname, isc_result_totext(result)); classstr, sep, vname, isc_result_totext(result));
if (raw != NULL) { if (raw != NULL) {

View File

@ -62,8 +62,8 @@ isc_backtrace_symbols_fd(void *const *buffer, int size, int fd) {
} }
void void
isc_backtrace_log(isc_log_t *lctx, isc_logcategory_t *category, isc_backtrace_log(isc_logcategory_t *category, isc_logmodule_t *module,
isc_logmodule_t *module, int level) { int level) {
void *tracebuf[ISC_BACKTRACE_MAXFRAME]; void *tracebuf[ISC_BACKTRACE_MAXFRAME];
int nframes; int nframes;
char **strs; char **strs;
@ -77,7 +77,7 @@ isc_backtrace_log(isc_log_t *lctx, isc_logcategory_t *category,
return; return;
} }
for (int i = 0; i < nframes; i++) { for (int i = 0; i < nframes; i++) {
isc_log_write(lctx, category, module, level, "%s", strs[i]); isc_log_write(category, module, level, "%s", strs[i]);
} }
} }
@ -107,9 +107,8 @@ isc_backtrace_symbols_fd(void *const *buffer, int size, int fd) {
} }
void void
isc_backtrace_log(isc_log_t *lctx, isc_logcategory_t *category, isc_backtrace_log(isc_logcategory_t *category, isc_logmodule_t *module,
isc_logmodule_t *module, int level) { int level) {
UNUSED(lctx);
UNUSED(category); UNUSED(category);
UNUSED(module); UNUSED(module);
UNUSED(level); UNUSED(level);

View File

@ -370,7 +370,7 @@ isc_file_openuniquemode(char *templet, int mode, FILE **fp) {
if (f == NULL) { if (f == NULL) {
result = isc__errno2result(errno); result = isc__errno2result(errno);
if (remove(templet) < 0) { if (remove(templet) < 0) {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_FILE, ISC_LOG_ERROR, ISC_LOGMODULE_FILE, ISC_LOG_ERROR,
"remove '%s': failed", templet); "remove '%s': failed", templet);
} }

View File

@ -105,8 +105,8 @@ isc_backtrace_symbols_fd(void *const *buffer, int size, int fd);
*/ */
void void
isc_backtrace_log(isc_log_t *lctx, isc_logcategory_t *category, isc_backtrace_log(isc_logcategory_t *category, isc_logmodule_t *module,
isc_logmodule_t *module, int level); int level);
/* /*
* Write a backtrace to the log. * Write a backtrace to the log.
*/ */

View File

@ -160,7 +160,6 @@ typedef union isc_logdestination {
* the order of the names. * the order of the names.
*/ */
extern isc_logcategory_t isc_categories[]; extern isc_logcategory_t isc_categories[];
extern isc_log_t *isc_lctx __attribute__((__deprecated__));
extern isc_logmodule_t isc_modules[]; extern isc_logmodule_t isc_modules[];
/*@}*/ /*@}*/
@ -185,7 +184,7 @@ extern isc_logmodule_t isc_modules[];
ISC_LANG_BEGINDECLS ISC_LANG_BEGINDECLS
void void
isc_logconfig_create(isc_log_t *lctx, isc_logconfig_t **lcfgp); isc_logconfig_create(isc_logconfig_t **lcfgp);
/*%< /*%<
* Create the data structure that holds all of the configurable information * Create the data structure that holds all of the configurable information
* about where messages are actually supposed to be sent -- the information * about where messages are actually supposed to be sent -- the information
@ -227,9 +226,9 @@ isc_logconfig_create(isc_log_t *lctx, isc_logconfig_t **lcfgp);
*/ */
isc_logconfig_t * isc_logconfig_t *
isc_logconfig_get(isc_log_t *lctx); isc_logconfig_get(void);
void void
isc_logconfig_set(isc_log_t *lctx, isc_logconfig_t *lcfg); isc_logconfig_set(isc_logconfig_t *lcfg);
/*%< /*%<
* Getter/setter for a configuration with a logging context. * Getter/setter for a configuration with a logging context.
* *
@ -264,7 +263,7 @@ isc_logconfig_destroy(isc_logconfig_t **lcfgp);
*/ */
void void
isc_log_registercategories(isc_log_t *lctx, isc_logcategory_t categories[]); isc_log_registercategories(isc_logcategory_t categories[]);
/*%< /*%<
* Identify logging categories a library will use. * Identify logging categories a library will use.
* *
@ -302,7 +301,7 @@ isc_log_registercategories(isc_log_t *lctx, isc_logcategory_t categories[]);
*/ */
void void
isc_log_registermodules(isc_log_t *lctx, isc_logmodule_t modules[]); isc_log_registermodules(isc_logmodule_t modules[]);
/*%< /*%<
* Identify logging categories a library will use. * Identify logging categories a library will use.
* *
@ -500,10 +499,10 @@ isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
* meaningful error. * meaningful error.
*/ */
void void
isc_log_write(isc_log_t *lctx, isc_logcategory_t *category, isc_log_write(isc_logcategory_t *category, isc_logmodule_t *module, int level,
isc_logmodule_t *module, int level, const char *format, ...) const char *format, ...)
ISC_FORMAT_PRINTF(5, 6); ISC_FORMAT_PRINTF(4, 5);
/*% /*%
* Write a message to the log channels. * Write a message to the log channels.
@ -538,14 +537,13 @@ isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
* meaningful error. * meaningful error.
*/ */
void void
isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category, isc_log_vwrite(isc_logcategory_t *category, isc_logmodule_t *module, int level,
isc_logmodule_t *module, int level, const char *format, const char *format, va_list args)
va_list args)
ISC_FORMAT_PRINTF(5, 0); ISC_FORMAT_PRINTF(4, 0);
void void
isc_log_setdebuglevel(isc_log_t *lctx, unsigned int level); isc_log_setdebuglevel(unsigned int level);
/*%< /*%<
* Set the debugging level used for logging. * Set the debugging level used for logging.
* *
@ -560,7 +558,7 @@ isc_log_setdebuglevel(isc_log_t *lctx, unsigned int level);
*/ */
unsigned int unsigned int
isc_log_getdebuglevel(isc_log_t *lctx); isc_log_getdebuglevel(void);
/*%< /*%<
* Get the current debugging level. * Get the current debugging level.
* *
@ -579,7 +577,7 @@ isc_log_getdebuglevel(isc_log_t *lctx);
*/ */
bool bool
isc_log_wouldlog(isc_log_t *lctx, int level); isc_log_wouldlog(int level);
/*%< /*%<
* Determine whether logging something to 'lctx' at 'level' would * Determine whether logging something to 'lctx' at 'level' would
* actually cause something to be logged somewhere. * actually cause something to be logged somewhere.
@ -674,7 +672,7 @@ isc_log_opensyslog(const char *tag, int options, int facility);
*/ */
void void
isc_log_closefilelogs(isc_log_t *lctx); isc_log_closefilelogs(void);
/*%< /*%<
* Close all open files used by #ISC_LOG_TOFILE channels. * Close all open files used by #ISC_LOG_TOFILE channels.
* *
@ -696,7 +694,7 @@ isc_log_closefilelogs(isc_log_t *lctx);
*/ */
isc_logcategory_t * isc_logcategory_t *
isc_log_categorybyname(isc_log_t *lctx, const char *name); isc_log_categorybyname(const char *name);
/*%< /*%<
* Find a category by its name. * Find a category by its name.
* *
@ -714,7 +712,7 @@ isc_log_categorybyname(isc_log_t *lctx, const char *name);
*/ */
isc_logmodule_t * isc_logmodule_t *
isc_log_modulebyname(isc_log_t *lctx, const char *name); isc_log_modulebyname(const char *name);
/*%< /*%<
* Find a module by its name. * Find a module by its name.
* *

View File

@ -49,7 +49,6 @@ typedef void(isc_httpdondestroy_t)(void *); /*%< Callback on destroying httpd */
typedef struct isc_interface isc_interface_t; /*%< Interface */ typedef struct isc_interface isc_interface_t; /*%< Interface */
typedef struct isc_interfaceiter isc_interfaceiter_t; /*%< Interface Iterator */ typedef struct isc_interfaceiter isc_interfaceiter_t; /*%< Interface Iterator */
typedef struct isc_lex isc_lex_t; /*%< Lex */ typedef struct isc_lex isc_lex_t; /*%< Lex */
typedef struct isc_log isc_log_t; /*%< Log */
typedef struct isc_logcategory isc_logcategory_t; /*%< Log Category */ typedef struct isc_logcategory isc_logcategory_t; /*%< Log Category */
typedef struct isc_logconfig isc_logconfig_t; /*%< Log Configuration */ typedef struct isc_logconfig isc_logconfig_t; /*%< Log Configuration */
typedef struct isc_logmodule isc_logmodule_t; /*%< Log Module */ typedef struct isc_logmodule isc_logmodule_t; /*%< Log Module */

View File

@ -50,6 +50,11 @@ static thread_local bool forcelog = false;
*/ */
#define LOG_BUFFER_SIZE (8 * 1024) #define LOG_BUFFER_SIZE (8 * 1024)
/*
* Private isc_log_t data type.
*/
typedef struct isc_log isc_log_t;
/*! /*!
* This is the structure that holds each named channel. A simple linked * This is the structure that holds each named channel. A simple linked
* list chains all of the channels together, so an individual channel is * list chains all of the channels together, so an individual channel is
@ -189,7 +194,6 @@ static isc_logchannellist_t default_channel;
/*! /*!
* libisc logs to this context. * libisc logs to this context.
*/ */
isc_log_t *isc_lctx __attribute__((__deprecated__)) = NULL;
static isc_log_t *isc__lctx = NULL; static isc_log_t *isc__lctx = NULL;
/*! /*!
@ -203,15 +207,14 @@ static void
sync_channellist(isc_logconfig_t *lcfg); sync_channellist(isc_logconfig_t *lcfg);
static void static void
sync_highest_level(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_logconfig_t *lcfg); sync_highest_level(isc_logconfig_t *lcfg);
static isc_result_t static isc_result_t
greatest_version(isc_logfile_t *file, int versions, int *greatest); greatest_version(isc_logfile_t *file, int versions, int *greatest);
static void static void
isc_log_doit(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_logcategory_t *category, isc_log_doit(isc_logcategory_t *category, isc_logmodule_t *module, int level,
isc_logmodule_t *module, int level, const char *format, const char *format, va_list args) ISC_FORMAT_PRINTF(4, 0);
va_list args) ISC_FORMAT_PRINTF(5, 0);
/*@{*/ /*@{*/
/*! /*!
@ -232,8 +235,7 @@ isc_log_doit(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_logcategory_t *category,
****/ ****/
void void
isc_logconfig_create(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_logconfig_create(isc_logconfig_t **lcfgp) {
isc_logconfig_t **lcfgp) {
REQUIRE(lcfgp != NULL && *lcfgp == NULL); REQUIRE(lcfgp != NULL && *lcfgp == NULL);
REQUIRE(VALID_CONTEXT(isc__lctx)); REQUIRE(VALID_CONTEXT(isc__lctx));
@ -287,14 +289,14 @@ isc_logconfig_create(isc_log_t *__lctx ISC_ATTR_UNUSED,
} }
isc_logconfig_t * isc_logconfig_t *
isc_logconfig_get(isc_log_t *__lctx ISC_ATTR_UNUSED) { isc_logconfig_get(void) {
REQUIRE(VALID_CONTEXT(isc__lctx)); REQUIRE(VALID_CONTEXT(isc__lctx));
return (rcu_dereference(isc__lctx->logconfig)); return (rcu_dereference(isc__lctx->logconfig));
} }
void void
isc_logconfig_set(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_logconfig_t *lcfg) { isc_logconfig_set(isc_logconfig_t *lcfg) {
REQUIRE(VALID_CONTEXT(isc__lctx)); REQUIRE(VALID_CONTEXT(isc__lctx));
REQUIRE(VALID_CONFIG(lcfg)); REQUIRE(VALID_CONFIG(lcfg));
REQUIRE(lcfg->lctx == isc__lctx); REQUIRE(lcfg->lctx == isc__lctx);
@ -308,7 +310,7 @@ isc_logconfig_set(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_logconfig_t *lcfg) {
isc_logconfig_t *old_cfg = rcu_xchg_pointer(&isc__lctx->logconfig, isc_logconfig_t *old_cfg = rcu_xchg_pointer(&isc__lctx->logconfig,
lcfg); lcfg);
sync_highest_level(isc__lctx, lcfg); sync_highest_level(lcfg);
synchronize_rcu(); synchronize_rcu();
if (old_cfg != NULL) { if (old_cfg != NULL) {
@ -388,8 +390,7 @@ isc_logconfig_destroy(isc_logconfig_t **lcfgp) {
} }
void void
isc_log_registercategories(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_log_registercategories(isc_logcategory_t categories[]) {
isc_logcategory_t categories[]) {
REQUIRE(VALID_CONTEXT(isc__lctx)); REQUIRE(VALID_CONTEXT(isc__lctx));
REQUIRE(categories != NULL && categories[0].name != NULL); REQUIRE(categories != NULL && categories[0].name != NULL);
@ -434,7 +435,7 @@ isc_log_registercategories(isc_log_t *__lctx ISC_ATTR_UNUSED,
} }
isc_logcategory_t * isc_logcategory_t *
isc_log_categorybyname(isc_log_t *__lctx ISC_ATTR_UNUSED, const char *name) { isc_log_categorybyname(const char *name) {
isc_logcategory_t *catp; isc_logcategory_t *catp;
REQUIRE(VALID_CONTEXT(isc__lctx)); REQUIRE(VALID_CONTEXT(isc__lctx));
@ -459,8 +460,7 @@ isc_log_categorybyname(isc_log_t *__lctx ISC_ATTR_UNUSED, const char *name) {
} }
void void
isc_log_registermodules(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_log_registermodules(isc_logmodule_t modules[]) {
isc_logmodule_t modules[]) {
REQUIRE(VALID_CONTEXT(isc__lctx)); REQUIRE(VALID_CONTEXT(isc__lctx));
REQUIRE(modules != NULL && modules[0].name != NULL); REQUIRE(modules != NULL && modules[0].name != NULL);
@ -505,7 +505,7 @@ isc_log_registermodules(isc_log_t *__lctx ISC_ATTR_UNUSED,
} }
isc_logmodule_t * isc_logmodule_t *
isc_log_modulebyname(isc_log_t *__lctx ISC_ATTR_UNUSED, const char *name) { isc_log_modulebyname(const char *name) {
isc_logmodule_t *modp; isc_logmodule_t *modp;
REQUIRE(VALID_CONTEXT(isc__lctx)); REQUIRE(VALID_CONTEXT(isc__lctx));
@ -650,7 +650,7 @@ isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
*/ */
rcu_read_lock(); rcu_read_lock();
if (rcu_dereference(lcfg->lctx->logconfig) == lcfg) { if (rcu_dereference(lcfg->lctx->logconfig) == lcfg) {
sync_highest_level(lctx, lcfg); sync_highest_level(lcfg);
} }
rcu_read_unlock(); rcu_read_unlock();
@ -658,8 +658,8 @@ isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
} }
void void
isc_log_write(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_logcategory_t *category, isc_log_write(isc_logcategory_t *category, isc_logmodule_t *module, int level,
isc_logmodule_t *module, int level, const char *format, ...) { const char *format, ...) {
va_list args; va_list args;
/* /*
@ -667,22 +667,21 @@ isc_log_write(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_logcategory_t *category,
*/ */
va_start(args, format); va_start(args, format);
isc_log_doit(NULL, category, module, level, format, args); isc_log_doit(category, module, level, format, args);
va_end(args); va_end(args);
} }
void void
isc_log_vwrite(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_logcategory_t *category, isc_log_vwrite(isc_logcategory_t *category, isc_logmodule_t *module, int level,
isc_logmodule_t *module, int level, const char *format, const char *format, va_list args) {
va_list args) {
/* /*
* Contract checking is done in isc_log_doit(). * Contract checking is done in isc_log_doit().
*/ */
isc_log_doit(NULL, category, module, level, format, args); isc_log_doit(category, module, level, format, args);
} }
void void
isc_log_setdebuglevel(isc_log_t *__lctx ISC_ATTR_UNUSED, unsigned int level) { isc_log_setdebuglevel(unsigned int level) {
REQUIRE(VALID_CONTEXT(isc__lctx)); REQUIRE(VALID_CONTEXT(isc__lctx));
atomic_store_release(&isc__lctx->debug_level, level); atomic_store_release(&isc__lctx->debug_level, level);
@ -714,7 +713,7 @@ isc_log_setdebuglevel(isc_log_t *__lctx ISC_ATTR_UNUSED, unsigned int level) {
} }
unsigned int unsigned int
isc_log_getdebuglevel(isc_log_t *__lctx ISC_ATTR_UNUSED) { isc_log_getdebuglevel(void) {
REQUIRE(VALID_CONTEXT(isc__lctx)); REQUIRE(VALID_CONTEXT(isc__lctx));
return (atomic_load_acquire(&isc__lctx->debug_level)); return (atomic_load_acquire(&isc__lctx->debug_level));
@ -751,7 +750,7 @@ isc_log_opensyslog(const char *tag, int options, int facility) {
} }
void void
isc_log_closefilelogs(isc_log_t *__lctx ISC_ATTR_UNUSED) { isc_log_closefilelogs(void) {
REQUIRE(VALID_CONTEXT(isc__lctx)); REQUIRE(VALID_CONTEXT(isc__lctx));
rcu_read_lock(); rcu_read_lock();
@ -840,7 +839,7 @@ sync_channellist(isc_logconfig_t *lcfg) {
} }
static void static void
sync_highest_level(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_logconfig_t *lcfg) { sync_highest_level(isc_logconfig_t *lcfg) {
atomic_store(&isc__lctx->highest_level, lcfg->highest_level); atomic_store(&isc__lctx->highest_level, lcfg->highest_level);
atomic_store(&isc__lctx->dynamic, lcfg->dynamic); atomic_store(&isc__lctx->dynamic, lcfg->dynamic);
} }
@ -1297,7 +1296,7 @@ isc_log_open(isc_logchannel_t *channel) {
} }
ISC_NO_SANITIZE_THREAD bool ISC_NO_SANITIZE_THREAD bool
isc_log_wouldlog(isc_log_t *__lctx ISC_ATTR_UNUSED, int level) { isc_log_wouldlog(int level) {
/* /*
* Try to avoid locking the mutex for messages which can't * Try to avoid locking the mutex for messages which can't
* possibly be logged to any channels -- primarily debugging * possibly be logged to any channels -- primarily debugging
@ -1330,9 +1329,8 @@ isc_log_wouldlog(isc_log_t *__lctx ISC_ATTR_UNUSED, int level) {
} }
static void static void
isc_log_doit(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_logcategory_t *category, isc_log_doit(isc_logcategory_t *category, isc_logmodule_t *module, int level,
isc_logmodule_t *module, int level, const char *format, const char *format, va_list args) {
va_list args) {
int syslog_level; int syslog_level;
const char *time_string; const char *time_string;
char local_time[64]; char local_time[64];
@ -1366,7 +1364,7 @@ isc_log_doit(isc_log_t *__lctx ISC_ATTR_UNUSED, isc_logcategory_t *category,
REQUIRE(category->id < isc__lctx->category_count); REQUIRE(category->id < isc__lctx->category_count);
REQUIRE(module->id < isc__lctx->module_count); REQUIRE(module->id < isc__lctx->module_count);
if (!isc_log_wouldlog(isc__lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
@ -1662,12 +1660,12 @@ isc__log_initialize(void) {
isc_mutex_init(&isc__lctx->lock); isc_mutex_init(&isc__lctx->lock);
isc_log_registercategories(isc__lctx, isc_categories); isc_log_registercategories(isc_categories);
isc_log_registermodules(isc__lctx, isc_modules); isc_log_registermodules(isc_modules);
/* Create default logging configuration */ /* Create default logging configuration */
isc_logconfig_t *lcfg = NULL; isc_logconfig_t *lcfg = NULL;
isc_logconfig_create(isc__lctx, &lcfg); isc_logconfig_create(&lcfg);
sync_channellist(lcfg); sync_channellist(lcfg);
atomic_init(&isc__lctx->highest_level, lcfg->highest_level); atomic_init(&isc__lctx->highest_level, lcfg->highest_level);

View File

@ -466,9 +466,9 @@ void
isc_loopmgr_pause(isc_loopmgr_t *loopmgr) { isc_loopmgr_pause(isc_loopmgr_t *loopmgr) {
REQUIRE(VALID_LOOPMGR(loopmgr)); REQUIRE(VALID_LOOPMGR(loopmgr));
if (isc_log_wouldlog(isc_lctx, ISC_LOG_DEBUG(1))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_OTHER,
ISC_LOGMODULE_OTHER, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1),
"loop exclusive mode: starting"); "loop exclusive mode: starting");
} }
@ -488,10 +488,9 @@ isc_loopmgr_pause(isc_loopmgr_t *loopmgr) {
&(bool){ false }, true)); &(bool){ false }, true));
pause_loop(CURRENT_LOOP(loopmgr)); pause_loop(CURRENT_LOOP(loopmgr));
if (isc_log_wouldlog(isc_lctx, ISC_LOG_DEBUG(1))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_OTHER,
ISC_LOGMODULE_OTHER, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1), "loop exclusive mode: started");
"loop exclusive mode: started");
} }
} }
@ -499,20 +498,18 @@ void
isc_loopmgr_resume(isc_loopmgr_t *loopmgr) { isc_loopmgr_resume(isc_loopmgr_t *loopmgr) {
REQUIRE(VALID_LOOPMGR(loopmgr)); REQUIRE(VALID_LOOPMGR(loopmgr));
if (isc_log_wouldlog(isc_lctx, ISC_LOG_DEBUG(1))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_OTHER,
ISC_LOGMODULE_OTHER, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1), "loop exclusive mode: ending");
"loop exclusive mode: ending");
} }
RUNTIME_CHECK(atomic_compare_exchange_strong(&loopmgr->paused, RUNTIME_CHECK(atomic_compare_exchange_strong(&loopmgr->paused,
&(bool){ true }, false)); &(bool){ true }, false));
resume_loop(CURRENT_LOOP(loopmgr)); resume_loop(CURRENT_LOOP(loopmgr));
if (isc_log_wouldlog(isc_lctx, ISC_LOG_DEBUG(1))) { if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_OTHER,
ISC_LOGMODULE_OTHER, ISC_LOG_DEBUG(1), ISC_LOG_DEBUG(1), "loop exclusive mode: ended");
"loop exclusive mode: ended");
} }
} }

View File

@ -148,11 +148,11 @@ try_proto(int domain) {
len = sizeof(sin6); len = sizeof(sin6);
if (getsockname(s, (struct sockaddr *)&sin6, (void *)&len) < 0) if (getsockname(s, (struct sockaddr *)&sin6, (void *)&len) < 0)
{ {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
"retrieving the address of an IPv6 " "retrieving the address of an IPv6 "
"socket from the kernel failed."); "socket from the kernel failed.");
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR, ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
"IPv6 is not supported."); "IPv6 is not supported.");
result = ISC_R_NOTFOUND; result = ISC_R_NOTFOUND;
@ -160,12 +160,12 @@ try_proto(int domain) {
if (len == sizeof(struct sockaddr_in6)) { if (len == sizeof(struct sockaddr_in6)) {
result = ISC_R_SUCCESS; result = ISC_R_SUCCESS;
} else { } else {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOGMODULE_SOCKET,
ISC_LOG_ERROR, ISC_LOG_ERROR,
"IPv6 structures in kernel and " "IPv6 structures in kernel and "
"user space do not match."); "user space do not match.");
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_SOCKET, ISC_LOGMODULE_SOCKET,
ISC_LOG_ERROR, ISC_LOG_ERROR,
"IPv6 is not supported."); "IPv6 is not supported.");

View File

@ -2028,7 +2028,7 @@ log_server_error_response(const isc_nmsocket_t *socket,
char client_sabuf[ISC_SOCKADDR_FORMATSIZE]; char client_sabuf[ISC_SOCKADDR_FORMATSIZE];
char local_sabuf[ISC_SOCKADDR_FORMATSIZE]; char local_sabuf[ISC_SOCKADDR_FORMATSIZE];
if (!isc_log_wouldlog(isc_lctx, log_level)) { if (!isc_log_wouldlog(log_level)) {
return; return;
} }

View File

@ -1947,7 +1947,7 @@ isc__nmsocket_reset(isc_nmsocket_t *sock) {
int r = uv_tcp_close_reset(&sock->uv_handle.tcp, int r = uv_tcp_close_reset(&sock->uv_handle.tcp,
reset_shutdown); reset_shutdown);
if (r != 0) { if (r != 0) {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, isc_log_write(ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_NETMGR, ISC_LOG_DEBUG(1), ISC_LOGMODULE_NETMGR, ISC_LOG_DEBUG(1),
"TCP Reset (RST) failed: %s", "TCP Reset (RST) failed: %s",
uv_strerror(r)); uv_strerror(r));
@ -2550,7 +2550,7 @@ isc__nmsocket_log_tls_session_reuse(isc_nmsocket_t *sock, isc_tls_t *tls) {
REQUIRE(tls != NULL); REQUIRE(tls != NULL);
if (!isc_log_wouldlog(isc_lctx, log_level)) { if (!isc_log_wouldlog(log_level)) {
return; return;
}; };
@ -2588,7 +2588,7 @@ isc__netmgr_log(const isc_nm_t *netmgr, int level, const char *fmt, ...) {
char msgbuf[2048]; char msgbuf[2048];
va_list ap; va_list ap;
if (!isc_log_wouldlog(isc_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
@ -2596,8 +2596,8 @@ isc__netmgr_log(const isc_nm_t *netmgr, int level, const char *fmt, ...) {
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
va_end(ap); va_end(ap);
isc_log_write(isc_lctx, ISC_LOGCATEGORY_DEFAULT, ISC_LOGMODULE_NETMGR, isc_log_write(ISC_LOGCATEGORY_DEFAULT, ISC_LOGMODULE_NETMGR, level,
level, "netmgr %p: %s", netmgr, msgbuf); "netmgr %p: %s", netmgr, msgbuf);
} }
void void
@ -2605,7 +2605,7 @@ isc__nmsocket_log(const isc_nmsocket_t *sock, int level, const char *fmt, ...) {
char msgbuf[2048]; char msgbuf[2048];
va_list ap; va_list ap;
if (!isc_log_wouldlog(isc_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
@ -2613,8 +2613,8 @@ isc__nmsocket_log(const isc_nmsocket_t *sock, int level, const char *fmt, ...) {
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
va_end(ap); va_end(ap);
isc_log_write(isc_lctx, ISC_LOGCATEGORY_DEFAULT, ISC_LOGMODULE_NETMGR, isc_log_write(ISC_LOGCATEGORY_DEFAULT, ISC_LOGMODULE_NETMGR, level,
level, "socket %p: %s", sock, msgbuf); "socket %p: %s", sock, msgbuf);
} }
void void
@ -2623,7 +2623,7 @@ isc__nmhandle_log(const isc_nmhandle_t *handle, int level, const char *fmt,
char msgbuf[2048]; char msgbuf[2048];
va_list ap; va_list ap;
if (!isc_log_wouldlog(isc_lctx, level)) { if (!isc_log_wouldlog(level)) {
return; return;
} }
@ -2650,7 +2650,7 @@ isc__nm_received_proxy_header_log(isc_nmhandle_t *handle,
const char *real_addresses_msg = const char *real_addresses_msg =
"real source and destination addresses are used"; "real source and destination addresses are used";
if (!isc_log_wouldlog(isc_lctx, log_level)) { if (!isc_log_wouldlog(log_level)) {
return; return;
} }
@ -2673,9 +2673,8 @@ isc__nm_received_proxy_header_log(isc_nmhandle_t *handle,
real_peer_fmt, real_local_fmt, proto); real_peer_fmt, real_local_fmt, proto);
if (cmd == ISC_PROXY2_CMD_LOCAL) { if (cmd == ISC_PROXY2_CMD_LOCAL) {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_DEFAULT, isc_log_write(ISC_LOGCATEGORY_DEFAULT, ISC_LOGMODULE_NETMGR,
ISC_LOGMODULE_NETMGR, log_level, log_level, "%s: command: LOCAL (%s)", common_msg,
"%s: command: LOCAL (%s)", common_msg,
real_addresses_msg); real_addresses_msg);
return; return;
} else if (cmd == ISC_PROXY2_CMD_PROXY) { } else if (cmd == ISC_PROXY2_CMD_PROXY) {
@ -2687,7 +2686,7 @@ isc__nm_received_proxy_header_log(isc_nmhandle_t *handle,
switch (socktype) { switch (socktype) {
case 0: case 0:
isc_log_write(isc_lctx, ISC_LOGCATEGORY_DEFAULT, isc_log_write(ISC_LOGCATEGORY_DEFAULT,
ISC_LOGMODULE_NETMGR, log_level, ISC_LOGMODULE_NETMGR, log_level,
"%s: command: PROXY (unspecified address " "%s: command: PROXY (unspecified address "
"and socket type, %s)", "and socket type, %s)",
@ -2715,8 +2714,8 @@ isc__nm_received_proxy_header_log(isc_nmhandle_t *handle,
dst_addr_msg = dst_addr_fmt; dst_addr_msg = dst_addr_fmt;
} }
isc_log_write(isc_lctx, ISC_LOGCATEGORY_DEFAULT, isc_log_write(ISC_LOGCATEGORY_DEFAULT, ISC_LOGMODULE_NETMGR,
ISC_LOGMODULE_NETMGR, log_level, log_level,
"%s: command: PROXY, socket type: %s, source: " "%s: command: PROXY, socket type: %s, source: "
"%s, destination: %s, TLVs: %s", "%s, destination: %s, TLVs: %s",
common_msg, socktype_name, src_addr_msg, common_msg, socktype_name, src_addr_msg,

Some files were not shown because too many files have changed in this diff Show More