From abfbedc0b1695cf60b5a72b1fd0c81387303656f Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Thu, 31 May 2018 12:24:42 +0100 Subject: [PATCH 1/2] Move NSID logging to its own category It is very verbose, so it is useful to be able to filter it out. --- doc/arm/Bv9ARM-book.xml | 2 +- doc/arm/logging-categories.xml | 10 ++++++++++ lib/dns/include/dns/log.h | 1 + lib/dns/log.c | 1 + lib/dns/resolver.c | 2 +- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml index ebda5e5690..4f428a45e1 100644 --- a/doc/arm/Bv9ARM-book.xml +++ b/doc/arm/Bv9ARM-book.xml @@ -6052,7 +6052,7 @@ options { queries to authoritative name servers during iterative resolution. If the authoritative server returns an NSID option in its response, then its contents are logged in - the resolver category at level + the nsid category at level info. The default is no. diff --git a/doc/arm/logging-categories.xml b/doc/arm/logging-categories.xml index 9d3856d444..25914633ab 100644 --- a/doc/arm/logging-categories.xml +++ b/doc/arm/logging-categories.xml @@ -193,6 +193,16 @@ + + + nsid + + + + NSID options received from upstream servers. + + + queries diff --git a/lib/dns/include/dns/log.h b/lib/dns/include/dns/log.h index 6f4d557a71..712cdfdff6 100644 --- a/lib/dns/include/dns/log.h +++ b/lib/dns/include/dns/log.h @@ -40,6 +40,7 @@ LIBDNS_EXTERNAL_DATA extern isc_logmodule_t dns_modules[]; #define DNS_LOGCATEGORY_SPILL (&dns_categories[15]) #define DNS_LOGCATEGORY_DNSTAP (&dns_categories[16]) #define DNS_LOGCATEGORY_ZONELOAD (&dns_categories[17]) +#define DNS_LOGCATEGORY_NSID (&dns_categories[18]) /* Backwards compatibility. */ #define DNS_LOGCATEGORY_GENERAL ISC_LOGCATEGORY_GENERAL diff --git a/lib/dns/log.c b/lib/dns/log.c index f1d78d7027..aaa281fc78 100644 --- a/lib/dns/log.c +++ b/lib/dns/log.c @@ -40,6 +40,7 @@ LIBDNS_EXTERNAL_DATA isc_logcategory_t dns_categories[] = { { "spill", 0 }, { "dnstap", 0 }, { "zoneload", 0 }, + { "nsid", 0 }, { NULL, 0 } }; diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 3c11ff2ee1..3b18f41254 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -6964,7 +6964,7 @@ log_nsid(isc_buffer_t *opt, size_t nsid_len, resquery_t *query, isc_sockaddr_format(&query->addrinfo->sockaddr, addrbuf, sizeof(addrbuf)); - isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, + isc_log_write(dns_lctx, DNS_LOGCATEGORY_NSID, DNS_LOGMODULE_RESOLVER, level, "received NSID %s (\"%s\") from %s", buf, pbuf, addrbuf); cleanup: From 4862d8ffc1dd1bdf47223c421275d981daca5a87 Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Thu, 31 May 2018 12:30:17 +0100 Subject: [PATCH 2/2] Add CHANGES and release notes entries 4957. [func] NSID logging (enabled by the "request-nsid" option) now has its own "nsid" category, instead of using the "resolver" category. [GL !331] --- CHANGES | 4 ++++ doc/arm/notes.xml | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGES b/CHANGES index 75efc6fb7a..1caec4916c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +4959. [func] NSID logging (enabled by the "request-nsid" option) + now has its own "nsid" category, instead of using the + "resolver" category. [GL !332] + 4958. [bug] Remove redundant space from NSEC3 record. [GL #281] 4957. [func] The default setting for "dnssec-validation" is now diff --git a/doc/arm/notes.xml b/doc/arm/notes.xml index 5032df3741..553c7da716 100644 --- a/doc/arm/notes.xml +++ b/doc/arm/notes.xml @@ -263,6 +263,13 @@ [GL #203] + + + NSID logging (enabled by the request-nsid + option) now has its own nsid category, + instead of using the resolver category. + +