From 05d69bd7a44d3b28ad4a993f97656ad8de115178 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Tue, 31 Dec 2024 05:40:48 +0100 Subject: [PATCH] dns_message_logfmtpacket(): drop 'style' parameter Both existing callers of the dns_message_logfmtpacket() function set the argument passed as 'style' to &dns_master_style_comment. To simplify these call sites, drop the 'style' parameter from the prototype for dns_message_logfmtpacket() and use a fixed value of &dns_master_style_comment in the function's body instead. --- lib/dns/include/dns/message.h | 4 +--- lib/dns/message.c | 7 +++---- lib/dns/resolver.c | 5 ++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/dns/include/dns/message.h b/lib/dns/include/dns/message.h index 0189bbf297a..67c9640d9a6 100644 --- a/lib/dns/include/dns/message.h +++ b/lib/dns/include/dns/message.h @@ -1404,8 +1404,7 @@ void dns_message_logfmtpacket(dns_message_t *message, const char *description, const isc_sockaddr_t *address, isc_logcategory_t category, isc_logmodule_t module, - const dns_master_style_t *style, int level, - isc_mem_t *mctx); + int level, isc_mem_t *mctx); /*%< * Log 'message' at the specified logging parameters. * @@ -1422,7 +1421,6 @@ dns_message_logfmtpacket(dns_message_t *message, const char *description, * \li address to be non NULL. * \li category to be valid. * \li module to be valid. - * \li style to be valid. * \li mctx to be a valid. */ diff --git a/lib/dns/message.c b/lib/dns/message.c index a5324eb10e9..e4631839fac 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -4741,12 +4741,11 @@ void dns_message_logfmtpacket(dns_message_t *message, const char *description, const isc_sockaddr_t *address, isc_logcategory_t category, isc_logmodule_t module, - const dns_master_style_t *style, int level, - isc_mem_t *mctx) { + int level, isc_mem_t *mctx) { REQUIRE(address != NULL); - logfmtpacket(message, description, address, category, module, style, - level, mctx); + logfmtpacket(message, description, address, category, module, + &dns_master_style_comment, level, mctx); } static void diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index f9a2a9708ea..0b0f87a1466 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -2712,7 +2712,7 @@ resquery_send(resquery_t *query) { dns_message_logfmtpacket( fctx->qmessage, "sending packet to", &query->addrinfo->sockaddr, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_PACKETS, - &dns_master_style_comment, ISC_LOG_DEBUG(11), fctx->mctx); + ISC_LOG_DEBUG(11), fctx->mctx); /* * We're now done with the query message. @@ -9732,8 +9732,7 @@ rctx_logpacket(respctx_t *rctx) { dns_message_logfmtpacket( rctx->query->rmessage, "received packet from", &rctx->query->addrinfo->sockaddr, DNS_LOGCATEGORY_RESOLVER, - DNS_LOGMODULE_PACKETS, &dns_master_style_comment, - ISC_LOG_DEBUG(10), fctx->mctx); + DNS_LOGMODULE_PACKETS, ISC_LOG_DEBUG(10), fctx->mctx); #ifdef HAVE_DNSTAP /* -- 2.47.3