]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Rename dns_message_logpacket()
authorMichał Kępień <michal@isc.org>
Tue, 31 Dec 2024 04:40:48 +0000 (05:40 +0100)
committerMichał Kępień <michal@isc.org>
Tue, 31 Dec 2024 04:40:48 +0000 (05:40 +0100)
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.

lib/dns/include/dns/message.h
lib/dns/message.c
lib/dns/resolver.c
lib/dns/xfrin.c

index 1376b5d5a46b4c26fbe1dd8bf6467dadee0d4613..c7ebf49591c57cd9d43076f5b5ac66c055e3eb70 100644 (file)
@@ -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.
index 1609796f73a376df098d3b76fe98dcbfbf18895e..c7441071a8b5ee2adb965afbacc6bcd4d3098b0f 100644 (file)
@@ -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,
index dcf02145c3827b5fbc9b39db9beb39b5872273b0..9339f5e4dce926f440d9ab7c9d01b4747f1fdd45 100644 (file)
@@ -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);
index 47f58aed5f31d14e020e55b72040c4c8ea33bdf3..617f8456c0e7a8cfa072b3bf6c29e3024203d076 100644 (file)
@@ -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);