From nobody Tue Jul 21 08:56:48 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4h4B8J64Q5z6lcHr for ; Tue, 21 Jul 2026 08:56:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h4B8J57Ygz3d5C for ; Tue, 21 Jul 2026 08:56:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784624208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=McomTN/TO+K97GLt+/waj787jXVgRbMQ5Wtrof66KW4=; b=cfFCLlpADkdrophusWj4I7WiOtgOoLt5zr9ks9lWJQgDWbod1dRPYT5cFga2N9BVNq2ehh t4C1fFTxcidNwFopMJwE6e2eA3RPoXrVs9aUdIs1y9W/pfjMNqmeIJqp/FMQV5/RcMRROr q+CHXIxuOBjOvDEPKCxKVAah0vgxC07MgsiAygMptS42mkDh3Wly0cx9UGnK2C73qZZ5aE G8sqsbZmBMRDH2p5WDCjiZNGMmJldrOG69+k8rh4Lkx31r8xMCDRZY7jifH/hexbjnaQle dC4bwrB3ysDCAuR+wM3Pj+Z9mHAeCp7UfdCK4hdjOBi2EuJZdxuIxKX/XvYW1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784624208; a=rsa-sha256; cv=none; b=OX1Sl0vx/qAEvWD/8topu6bWvF9IIvh544Cs29WU7LT975gLNqNNmUymsQtkw+QcZ/hTT9 asWldZZGiWIwworvP4cnAfuldPGBP1c+ocfSLrIdWX+hPRDecJ2ppuYFaI5hVdJmeulVup WGGHcsgSM449ZSZp8PF0e4Rf6oKSEP6XVPhKRO6Ehf375m4Rh37wZreXyNRI+l9/y/V4Ph Vfk1MLRky6GdHJIoCRQV/P4dBJFMK61KmmWcJUOdG2wuXBEwSkcbPYubq9ePRl/YyzwpUZ 5o9zSOXnl0MhfCuTiGx96BGhBlrEaY5DaIR5+w04YmeUjuVwtsWd1a13/t13mA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784624208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=McomTN/TO+K97GLt+/waj787jXVgRbMQ5Wtrof66KW4=; b=we7KTfXPSV4dRD1pFwHGwsqsYz3i7tXeygaSXcB1zsQAqEfpijuaBGiJ7Qkben/OCLN9jU FdmaV/snU5KKf/rQMWogj2tfO09qkuQIJIFPI+C4TTdNuJW0d7KFNWEypoDOQyh8yT5Lss oPDWBQohnwteWE1h9xaOUdQPtmRQPWxhoyK4cyRPoDCe3JbDh/JuQeM5RI10F/OgyQi8D3 TPW3L0nXM9BQ95HN8CAmes2JAlEVDDI+PbY2pl1WJX9Je6JIMgDPMTlOdtA0ddgsABmivI JBJBLFqByLjRfL7PePU5475oLiN43IO10Ky0a4HmlBoakjBuYNgtodvxMAGMMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h4B8J3WnKzjBG for ; Tue, 21 Jul 2026 08:56:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22307 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 21 Jul 2026 08:56:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: b796284f643d - stable/14 - libc: Disable debugging code in the resolver. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b796284f643dc8c658e328e1d53dc3c81471bba8 Auto-Submitted: auto-generated Date: Tue, 21 Jul 2026 08:56:48 +0000 Message-Id: <6a5f3450.22307.3ff3429a@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b796284f643dc8c658e328e1d53dc3c81471bba8 commit b796284f643dc8c658e328e1d53dc3c81471bba8 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-24 14:01:00 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-07-21 08:54:59 +0000 libc: Disable debugging code in the resolver. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D37319 (cherry picked from commit cd0756cef21079104967969e275c18b84dc45053) --- lib/libc/net/gethostbydns.c | 6 ++++++ lib/libc/net/res_config.h | 4 ++-- lib/libc/resolv/res_debug.h | 2 +- lib/libc/resolv/res_init.c | 6 ------ lib/libc/resolv/res_mkquery.c | 5 ----- lib/libc/resolv/res_mkupdate.c | 4 ---- lib/libc/resolv/res_query.c | 5 ----- lib/libc/resolv/res_send.c | 18 ++++++++++-------- 8 files changed, 19 insertions(+), 31 deletions(-) diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c index 415a3c32819c..61b14f46ed1f 100644 --- a/lib/libc/net/gethostbydns.c +++ b/lib/libc/net/gethostbydns.c @@ -78,8 +78,10 @@ static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.23 1998/04/07 04:59:46 vi #define SPRINTF(x) ((size_t)sprintf x) +#ifdef DEBUG static const char AskedForGot[] = "gethostby*.gethostanswer: asked for \"%s\", got \"%s\""; +#endif #ifdef RESOLVSORT static void addrsort(char **, int, res_state); @@ -303,8 +305,10 @@ gethostanswer(const querybuf *answer, int anslen, const char *qname, int qtype, switch (type) { case T_PTR: if (strcasecmp(tname, bp) != 0) { +#ifdef DEBUG syslog(LOG_NOTICE|LOG_AUTH, AskedForGot, qname, bp); +#endif cp += n; continue; /* XXX - had_error++ ? */ } @@ -351,8 +355,10 @@ gethostanswer(const querybuf *answer, int anslen, const char *qname, int qtype, case T_A: case T_AAAA: if (strcasecmp(he->h_name, bp) != 0) { +#ifdef DEBUG syslog(LOG_NOTICE|LOG_AUTH, AskedForGot, he->h_name, bp); +#endif cp += n; continue; /* XXX - had_error++ ? */ } diff --git a/lib/libc/net/res_config.h b/lib/libc/net/res_config.h index f049d6817b7a..39a1b5f1486f 100644 --- a/lib/libc/net/res_config.h +++ b/lib/libc/net/res_config.h @@ -1,5 +1,5 @@ -#define DEBUG 1 /* enable debugging code (needed for dig) */ +//#define DEBUG /* enable debugging code */ #define RESOLVSORT /* allow sorting of addresses in gethostbyname */ -#undef SUNSECURITY /* verify gethostbyaddr() calls - WE DON'T NEED IT */ +//#define SUNSECURITY /* verify gethostbyaddr() calls */ #define MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */ diff --git a/lib/libc/resolv/res_debug.h b/lib/libc/resolv/res_debug.h index dd048116fb49..ccae03e625aa 100644 --- a/lib/libc/resolv/res_debug.h +++ b/lib/libc/resolv/res_debug.h @@ -23,7 +23,7 @@ #ifndef DEBUG # define Dprint(cond, args) /*empty*/ # define DprintQ(cond, args, query, size) /*empty*/ -# define Aerror(statp, file, string, error, address) /*empty*/ +# define Aerror(statp, file, string, error, address, alen) /*empty*/ # define Perror(statp, file, string, error) /*empty*/ #else # define Dprint(cond, args) if (cond) {fprintf args;} else {} diff --git a/lib/libc/resolv/res_init.c b/lib/libc/resolv/res_init.c index ea7d09518746..496a9056da6d 100644 --- a/lib/libc/resolv/res_init.c +++ b/lib/libc/resolv/res_init.c @@ -112,12 +112,6 @@ static const char rcsid[] = "$Id: res_init.c,v 1.26 2008/12/11 09:59:00 marka Ex #include "res_private.h" -/*% Options. Should all be left alone. */ -#define RESOLVSORT -#ifndef DEBUG -#define DEBUG -#endif - #ifdef SOLARIS2 #include #endif diff --git a/lib/libc/resolv/res_mkquery.c b/lib/libc/resolv/res_mkquery.c index a7acbd7334d3..330ff71bde94 100644 --- a/lib/libc/resolv/res_mkquery.c +++ b/lib/libc/resolv/res_mkquery.c @@ -80,11 +80,6 @@ static const char rcsid[] = "$Id: res_mkquery.c,v 1.10 2008/12/11 09:59:00 marka #include #include "port_after.h" -/* Options. Leave them on. */ -#ifndef DEBUG -#define DEBUG -#endif - extern const char *_res_opcodes[]; /*% diff --git a/lib/libc/resolv/res_mkupdate.c b/lib/libc/resolv/res_mkupdate.c index d817c5b0728c..02197cd6952f 100644 --- a/lib/libc/resolv/res_mkupdate.c +++ b/lib/libc/resolv/res_mkupdate.c @@ -51,10 +51,6 @@ static const char rcsid[] = "$Id: res_mkupdate.c,v 1.10 2008/12/11 09:59:00 mark #include "port_after.h" -/* Options. Leave them on. */ -#ifndef DEBUG -#define DEBUG -#endif #define MAXPORT 1024 static int getnum_str(u_char **, u_char *); diff --git a/lib/libc/resolv/res_query.c b/lib/libc/resolv/res_query.c index 43be4beb93eb..66b493b2f4e1 100644 --- a/lib/libc/resolv/res_query.c +++ b/lib/libc/resolv/res_query.c @@ -85,11 +85,6 @@ static const char rcsid[] = "$Id: res_query.c,v 1.11 2008/11/14 02:36:51 marka E #include #include "port_after.h" -/* Options. Leave them on. */ -#ifndef DEBUG -#define DEBUG -#endif - #if PACKETSZ > 1024 #define MAXPACKET PACKETSZ #else diff --git a/lib/libc/resolv/res_send.c b/lib/libc/resolv/res_send.c index ebb7c738c812..19352a7395ad 100644 --- a/lib/libc/resolv/res_send.c +++ b/lib/libc/resolv/res_send.c @@ -116,10 +116,6 @@ static const char rcsid[] = "$Id: res_send.c,v 1.22 2009/01/22 23:49:23 tbox Exp #include "un-namespace.h" -/* Options. Leave them on. */ -#ifndef DEBUG -#define DEBUG -#endif #include "res_debug.h" #include "res_private.h" @@ -142,9 +138,11 @@ static int send_dg(res_state, const u_char *, int, u_char *, int, int *, int, int, int *, int *); +#ifdef DEBUG static void Aerror(const res_state, FILE *, const char *, int, const struct sockaddr *, int); static void Perror(const res_state, FILE *, const char *, int); +#endif static int sock_eq(struct sockaddr *, struct sockaddr *); #if defined(NEED_PSELECT) && !defined(USE_POLL) && !defined(USE_KQUEUE) static int pselect(int, void *, void *, void *, @@ -306,7 +304,9 @@ res_nsend(res_state statp, #ifdef USE_KQUEUE int kq; #endif +#ifdef DEBUG char abuf[NI_MAXHOST]; +#endif /* No name servers or res_init() failure */ if (statp->nscount == 0 || EXT(statp).ext == NULL) { @@ -422,10 +422,10 @@ res_nsend(res_state statp, */ for (tries = 0; tries < statp->retry; tries++) { for (ns = 0; ns < statp->nscount; ns++) { - struct sockaddr *nsap; - int nsaplen; - nsap = get_nsaddr(statp, ns); - nsaplen = get_salen(nsap); + struct sockaddr *nsap = get_nsaddr(statp, ns); +#ifdef DEBUG + int nsaplen = get_salen(nsap); +#endif statp->_flags &= ~RES_F_LASTMASK; statp->_flags |= (ns << RES_F_LASTSHIFT); same_ns: @@ -1092,6 +1092,7 @@ send_dg(res_state statp, return (resplen); } +#ifdef DEBUG static void Aerror(const res_state statp, FILE *file, const char *string, int error, const struct sockaddr *address, int alen) @@ -1123,6 +1124,7 @@ Perror(const res_state statp, FILE *file, const char *string, int error) { string, strerror(error)); errno = save; } +#endif static int sock_eq(struct sockaddr *a, struct sockaddr *b) {