From nobody Sat Dec 03 16:01:50 2022 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 4NPZLl1459z4jjkk; Sat, 3 Dec 2022 16:01:51 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NPZLl0cfMz3t57; Sat, 3 Dec 2022 16:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670083311; 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=GZ4AyreQCr0Za5v/Xerfvw5xw4zm4oMLlQnXxNRDDe4=; b=BMPDevgaCIiiwaBHbLzuXmrBhyfv6Kba5VPBC591WlFNPwXqoNuwt1QUYTsuLxaopiDPRz NmweHMHnI4VqPg3xI2PGs3CLUIuUbfOE6sT/GJ6+as9vCxaZmFwxLRLnG7ue40dy7QfXVq ZsI5vJ1yrfDgMLirTXIttylQblVIvQ2p8y8qgrgGYW9APz3/I5AUsoMaSCv/0UOWmbN9b9 3ziYc9kHlr/e3prA/QN0QV5NH25vVCVkk0NcGjVrM6PIud9B8eSz+jSPGG8FnyokNEmOqm 3DZn3s8Z6NzR9vy9FmvNWtnm6zusXFRO4wf689T4ukvzEjJXp4tdridVD5qA3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670083311; 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=GZ4AyreQCr0Za5v/Xerfvw5xw4zm4oMLlQnXxNRDDe4=; b=JFtn4wSd7HbQSyCTy/14TyswQYLO0tabRTSxq+L1Sax34d62nNmBRputsqyNuYpZg2VaT4 QxiVd9h5wEjCSuanuHMxniao11n/eiWTEEWA7wkPIS+Uld1HrVBXfJR2Ey0dA7zHGQcAMT eAKw5NlHaSLYzYwc6texpLzbazkrHUC2aJJJrMn9j0eJWXFgb9wVKxcJv5fquEVHTFUmsP 97FhfSPv18WjzyuWvdR3ZXepTyFZhOq5jEWkNbSawxfIni5e+rExVpXCS0R55THkWHesjL Xk+IoS5Bhc75RxDfdOyyyFzHe6kKrcCOSmtt8aCRwAp46MHi8UebvwKUM7Im1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670083311; a=rsa-sha256; cv=none; b=BDOr/Wpk+EfUSbYP3VBZom9aTerxS5UX+MnCqusVR3RHgFOulynuVHWh1TobecStcGLGHV N4hPBrQw3BYf/RU2XbmSGJbOP7eQ2xDmLusiJT9etj30I+ssXWclcJB6UKamBzww+I8cnh N/567fGaLLcFtI96ms3CjuGNBXfr78CGS+dLwWgsHJokjimc/Bwx2NC1xJyXDD+OKTDdd+ 9u9L7YlQA4/jymiGcP33f5V7DcSgnUIkJkuyJ1W9/ffvnNlRf0gMhfM5K7g892M5M+9IlU Cja11r4yAgFPfLNFKpLgHM6TdqEwxdVrWyWSz4CVypVXWiNb2CxlkFanCkqEDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NPZLk6nwQz11SR; Sat, 3 Dec 2022 16:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2B3G1o6K007861; Sat, 3 Dec 2022 16:01:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B3G1oFk007860; Sat, 3 Dec 2022 16:01:50 GMT (envelope-from git) Date: Sat, 3 Dec 2022 16:01:50 GMT Message-Id: <202212031601.2B3G1oFk007860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mike Karels Subject: git: 870d2ff30528 - stable/13 - netdb.h: re-enable EAI_ADDRFAMILY, EAI_NODATA 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 870d2ff3052822dd6b46f2c07c442926d637130b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=870d2ff3052822dd6b46f2c07c442926d637130b commit 870d2ff3052822dd6b46f2c07c442926d637130b Author: Mike Karels AuthorDate: 2022-11-02 15:43:04 +0000 Commit: Mike Karels CommitDate: 2022-12-03 15:15:50 +0000 netdb.h: re-enable EAI_ADDRFAMILY, EAI_NODATA EAI_ADDRFAMILY and EAI_NODATA are not in RFC 3493, but are available and used in many other systems. It is desirable to have at least one of them in order to distinguish between names that do not resolve and those that do not have the requested address type. A change to getaddrinfo() will use EAI_ADDRFAMILY. Both were "#if 0"; re-enable, conditioned on __BSD_VISIBLE, and update comments. Also add comments and __BSD_VISIBLE conditional for the last three EAI errors, which are not in the RFC or POSIX. Note, all of these are available in NetBSD and OpenBSD, and EAI_ADDRFAMILY and EAI_NODATA are available in Linux (glibc). Reviewed in https://reviews.freebsd.org/D37139 with related changes. Reviewed by: bz (cherry picked from commit 40e4e12bd84154626d5b46c3e862c79da25bc403) --- include/netdb.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/netdb.h b/include/netdb.h index 731e7f7376b5..7eba378482a1 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -161,8 +161,8 @@ struct addrinfo { /* * Error return codes from gai_strerror(3), see RFC 3493. */ -#if 0 -/* Obsoleted on RFC 2553bis-02 */ +#if __BSD_VISIBLE /* not in POSIX */ +/* EAI_ADDRFAMILY was obsoleted by RFC 3493, used as extension */ #define EAI_ADDRFAMILY 1 /* address family for hostname not supported */ #endif #define EAI_AGAIN 2 /* name could not be resolved at this time */ @@ -170,17 +170,20 @@ struct addrinfo { #define EAI_FAIL 4 /* non-recoverable failure in name resolution */ #define EAI_FAMILY 5 /* address family not recognized */ #define EAI_MEMORY 6 /* memory allocation failure */ -#if 0 -/* Obsoleted on RFC 2553bis-02 */ +#if __BSD_VISIBLE /* not in POSIX */ +/* EAI_NODATA was obsoleted by RFC 3493, retained here as extension */ #define EAI_NODATA 7 /* no address associated with hostname */ #endif #define EAI_NONAME 8 /* name does not resolve */ #define EAI_SERVICE 9 /* service not recognized for socket type */ #define EAI_SOCKTYPE 10 /* intended socket type was not recognized */ #define EAI_SYSTEM 11 /* system error returned in errno */ +#if __BSD_VISIBLE /* not in POSIX */ +/* The following 3 are not in RFC 3493 or POSIX, retained for compatibility */ #define EAI_BADHINTS 12 /* invalid value for hints */ #define EAI_PROTOCOL 13 /* resolved protocol is unknown */ #define EAI_OVERFLOW 14 /* argument buffer overflow */ +#endif #define EAI_MAX 15 /*