From: Michał Kępień Date: Tue, 31 Dec 2024 04:40:48 +0000 (+0100) Subject: Rename dns_message_logpacket() X-Git-Tag: v9.21.4~9^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ab35f6839de18d0d7f7f537fe57d402203e6b84;p=thirdparty%2Fbind9.git Rename dns_message_logpacket() Since dns_message_logpacket() only takes a single socket address as a parameter (and it is always the sending socket's address), rename it to dns_message_logpacketfrom() so that its name better conveys its purpose and so that the difference in purpose between this function and dns_message_logpacketfromto() becomes more apparent. --- diff --git a/lib/dns/include/dns/message.h b/lib/dns/include/dns/message.h index 1376b5d5a46..c7ebf49591c 100644 --- a/lib/dns/include/dns/message.h +++ b/lib/dns/include/dns/message.h @@ -1396,9 +1396,10 @@ dns_message_gettimeadjust(dns_message_t *msg); */ void -dns_message_logpacket(dns_message_t *message, const char *description, - const isc_sockaddr_t *address, isc_logcategory_t category, - isc_logmodule_t module, int level, isc_mem_t *mctx); +dns_message_logpacketfrom(dns_message_t *message, const char *description, + const isc_sockaddr_t *address, + isc_logcategory_t category, isc_logmodule_t module, + int level, isc_mem_t *mctx); void dns_message_logpacketfromto(dns_message_t *message, const char *description, @@ -1410,8 +1411,8 @@ dns_message_logpacketfromto(dns_message_t *message, const char *description, * Log the provided DNS 'message' using the specified logging parameters, * prepending it with the given 'description'. * - * For dns_message_logpacket(), only the address of the sending socket must be - * provided (in the 'address' parameter). + * For dns_message_logpacketfrom(), only the address of the sending socket must + * be provided (in the 'address' parameter). * * For dns_message_logpacketfromto(), the addresses of both the sending socket * ('from') and the receiving socket ('to') must be provided. @@ -1419,7 +1420,7 @@ dns_message_logpacketfromto(dns_message_t *message, const char *description, * Requires: * \li 'message' be a valid DNS message. * \li 'description' to be non-NULL. - * \li 'address' to be non-NULL (dns_message_logpacket() only). + * \li 'address' to be non-NULL (dns_message_logpacketfrom() only). * \li 'from' and 'to' be non-NULL (dns_message_logpacketfromto() only). * \li 'category' to be a valid logging category. * \li 'module' to be a valid logging module. diff --git a/lib/dns/message.c b/lib/dns/message.c index 1609796f73a..c7441071a8b 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -4728,9 +4728,10 @@ dns_opcode_totext(dns_opcode_t opcode, isc_buffer_t *target) { } void -dns_message_logpacket(dns_message_t *message, const char *description, - const isc_sockaddr_t *address, isc_logcategory_t category, - isc_logmodule_t module, int level, isc_mem_t *mctx) { +dns_message_logpacketfrom(dns_message_t *message, const char *description, + const isc_sockaddr_t *address, + isc_logcategory_t category, isc_logmodule_t module, + int level, isc_mem_t *mctx) { REQUIRE(address != NULL); logfmtpacket(message, description, address, NULL, category, module, diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index dcf02145c38..9339f5e4dce 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -8162,7 +8162,7 @@ rctx_edns(respctx_t *rctx) { query->rmessage->rcode == dns_rcode_yxdomain) && bad_edns(fctx, &query->addrinfo->sockaddr)) { - dns_message_logpacket( + dns_message_logpacketfrom( query->rmessage, "received packet (bad edns) from", &query->addrinfo->sockaddr, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), fctx->mctx); @@ -8188,7 +8188,7 @@ rctx_edns(respctx_t *rctx) { * this should be safe to do for any rcode we limit it * to NOERROR and NXDOMAIN. */ - dns_message_logpacket( + dns_message_logpacketfrom( query->rmessage, "received packet (no opt) from", &query->addrinfo->sockaddr, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3), fctx->mctx); diff --git a/lib/dns/xfrin.c b/lib/dns/xfrin.c index 47f58aed5f3..617f8456c0e 100644 --- a/lib/dns/xfrin.c +++ b/lib/dns/xfrin.c @@ -1760,7 +1760,7 @@ xfrin_recv_done(isc_result_t result, isc_region_t *region, void *arg) { result = dns_message_parse(msg, &buffer, DNS_MESSAGEPARSE_PRESERVEORDER); if (result == ISC_R_SUCCESS) { - dns_message_logpacket( + dns_message_logpacketfrom( msg, "received message from", &xfr->primaryaddr, DNS_LOGCATEGORY_XFER_IN, DNS_LOGMODULE_XFER_IN, ISC_LOG_DEBUG(10), xfr->mctx);