diff --git a/CHANGES b/CHANGES index 9de9aeabe4..a03efd3840 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1158. [func] Report the client's address when logging notify + messages. + 1157. [func] match-clients and match-destinations now accept keys. [RT #2045] diff --git a/bin/named/client.c b/bin/named/client.c index 8011213b17..be771f4044 100644 --- a/bin/named/client.c +++ b/bin/named/client.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: client.c,v 1.201 2001/12/07 01:34:08 bwelling Exp $ */ +/* $Id: client.c,v 1.202 2001/12/10 23:09:21 marka Exp $ */ #include @@ -2144,12 +2144,7 @@ ns_client_name(ns_client_t *client, char *peerbuf, size_t len) { snprintf(peerbuf, len, "@%p", client); } -static void -ns_client_logv(ns_client_t *client, isc_logcategory_t *category, - isc_logmodule_t *module, int level, const char *fmt, va_list ap) - ISC_FORMAT_PRINTF(5, 0); - -static void +void ns_client_logv(ns_client_t *client, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *fmt, va_list ap) { diff --git a/bin/named/include/named/client.h b/bin/named/include/named/client.h index 5e5d282ebd..862fbbf63c 100644 --- a/bin/named/include/named/client.h +++ b/bin/named/include/named/client.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: client.h,v 1.63 2001/11/14 22:00:22 gson Exp $ */ +/* $Id: client.h,v 1.64 2001/12/10 23:09:24 marka Exp $ */ #ifndef NAMED_CLIENT_H #define NAMED_CLIENT_H 1 @@ -303,6 +303,10 @@ ns_client_log(ns_client_t *client, isc_logcategory_t *category, isc_logmodule_t *module, int level, const char *fmt, ...) ISC_FORMAT_PRINTF(5, 6); +void +ns_client_logv(ns_client_t *client, isc_logcategory_t *category, + isc_logmodule_t *module, int level, const char *fmt, va_list ap) ISC_FORMAT_PRINTF(5, 0); + void ns_client_aclmsg(const char *msg, dns_name_t *name, dns_rdataclass_t rdclass, char *buf, size_t len); diff --git a/bin/named/notify.c b/bin/named/notify.c index 1f35cf2743..7bd79a546c 100644 --- a/bin/named/notify.c +++ b/bin/named/notify.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: notify.c,v 1.25 2001/12/06 18:55:52 gson Exp $ */ +/* $Id: notify.c,v 1.26 2001/12/10 23:09:23 marka Exp $ */ #include @@ -36,11 +36,11 @@ */ static void -notify_log(int level, const char *fmt, ...) { +notify_log(ns_client_t *client, int level, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - isc_log_vwrite(ns_g_lctx, DNS_LOGCATEGORY_NOTIFY, NS_LOGMODULE_NOTIFY, + ns_client_logv(client, DNS_LOGCATEGORY_NOTIFY, NS_LOGMODULE_NOTIFY, level, fmt, ap); va_end(ap); } @@ -83,7 +83,7 @@ ns_notify_start(ns_client_t *client) { */ result = dns_message_firstname(request, DNS_SECTION_QUESTION); if (result != ISC_R_SUCCESS) { - notify_log(ISC_LOG_INFO, "notify question section empty"); + notify_log(client, ISC_LOG_INFO, "notify question section empty"); goto failure; } @@ -94,7 +94,7 @@ ns_notify_start(ns_client_t *client) { dns_message_currentname(request, DNS_SECTION_QUESTION, &zonename); zone_rdataset = ISC_LIST_HEAD(zonename->list); if (ISC_LIST_NEXT(zone_rdataset, link) != NULL) { - notify_log(ISC_LOG_INFO, + notify_log(client, ISC_LOG_INFO, "notify question section contains multiple RRs"); goto failure; } @@ -102,14 +102,14 @@ ns_notify_start(ns_client_t *client) { /* The zone section must have exactly one name. */ result = dns_message_nextname(request, DNS_SECTION_ZONE); if (result != ISC_R_NOMORE) { - notify_log(ISC_LOG_INFO, + notify_log(client, ISC_LOG_INFO, "notify question section contains multiple RRs"); goto failure; } /* The one rdataset must be an SOA. */ if (zone_rdataset->type != dns_rdatatype_soa) { - notify_log(ISC_LOG_INFO, + notify_log(client, ISC_LOG_INFO, "notify question section contains no SOA"); goto failure; } @@ -118,7 +118,7 @@ ns_notify_start(ns_client_t *client) { &zone); if (result != ISC_R_SUCCESS) { dns_name_format(zonename, str, sizeof(str)); - notify_log(ISC_LOG_INFO, + notify_log(client, ISC_LOG_INFO, "received notify for zone '%s': not authoritative", str); goto failure; @@ -133,7 +133,7 @@ ns_notify_start(ns_client_t *client) { break; default: dns_name_format(zonename, str, sizeof(str)); - notify_log(ISC_LOG_INFO, + notify_log(client, ISC_LOG_INFO, "received notify for zone '%s': not authoritative", str); goto failure;