From nobody Wed Nov 02 16:04:28 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 4N2Wt44RTtz4gG8g; Wed, 2 Nov 2022 16:04:28 +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 4N2Wt43w52z3gD7; Wed, 2 Nov 2022 16:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667405068; 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=72BKKI4X1fgfdQ2kcqyG+Iwjt5rCLEPPTzY+0qtVLUI=; b=MFdwx5dZivi1p9mseOIsQLOW5FuhjoHqlmZ1JPvaWoSqxF53aA/Z90CCRWwgOmshq7vLGB eBOQKWIULu3fCTiFCdV1YzNYHqOkBcg3oaIpn5SlShUsXHNy37PiVrZ1+I5LNP/E5yIzXm 2ofN4D+wefFy3AEkvsJuMoVgjoyAtqwSxNt/RtJXuxsxxO0IMuV36LQuVDnPVqKeQmCMS5 VOAUIbQQI8lnpKTthfWHpQyTRqv15ASgHual8E0lE8tkBDcJ5DoNGHJOYNrVR9SNV0M7q0 ehsp/lk5fc8uBoKLHpk8Ttdrw+Vm4TUtduMcYHCpVeFQYEwvOAPhn/1zhncWWw== 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 4N2Wt42zGZz12mJ; Wed, 2 Nov 2022 16:04:28 +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 2A2G4SsC080063; Wed, 2 Nov 2022 16:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A2G4STp080062; Wed, 2 Nov 2022 16:04:28 GMT (envelope-from git) Date: Wed, 2 Nov 2022 16:04:28 GMT Message-Id: <202211021604.2A2G4STp080062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 40e4e12bd841 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 40e4e12bd84154626d5b46c3e862c79da25bc403 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667405068; 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=72BKKI4X1fgfdQ2kcqyG+Iwjt5rCLEPPTzY+0qtVLUI=; b=EMCb+BpQ6eh8Wwd2hEFRWAqsRL/YCdDvlAYhc0AWZW9m/Gx8qOYBHbHFJp8FKdFBe2medi aWbh4zkCQuD7OTVrpu1wbgzS8RBD3XiO763g1y4kakieOxQ1s8cN+lo0diwnxMf0R7b/N4 zYrO/s1bwxt9gIdC2xQbzlyYMCA1VLjPzw3gjmc+ITAmfBG5/dmWGh1GodBybNeceb7lIK 5pAr6jd8KY9ZinfrIAk7KhNgs/XpffQSfC6iSvOftytfTjoCgi2CChKDQqMF9aYT29H2A4 dhoWbtYgP9kcMg5AzuZfbiUKbGaomff1wvEbL4dP2EMuZMq2uk3Cze0WVSg0Lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667405068; a=rsa-sha256; cv=none; b=pmcTkPuQI2eRS8Cn7oBwYdnwVCiw7gXkWYaP1ZKdA2jJEkFssKNRqNrd5lnuk5isbnGIfB YPL0xNvQxDnmM75hKgXEmlmUNYEV5pV9LFq1MP6fNK7aj2bOCaj7JhygaL/cocX1EvM0sS +YUFYRwunGoOiAHmvsjFBCiiKc+2LKSqi3osxRtAYq9jeo4mE7MvwCEuP0XizntGwmKii6 O5gK18XPeKOMcDQHEWwXRj+Y1qR1BPEnzWso/XZ7zGG99OmDbZGMDHM8wsEbXiSc0dPtWK 2G8+attRAZEDs12AiUvbjYSSnAbd+uPNOPr2y92U129WL7FCVZDtAHYhrF7Nog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=40e4e12bd84154626d5b46c3e862c79da25bc403 commit 40e4e12bd84154626d5b46c3e862c79da25bc403 Author: Mike Karels AuthorDate: 2022-11-02 15:43:04 +0000 Commit: Mike Karels CommitDate: 2022-11-02 16:03:30 +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 MFC after: 1 month --- include/netdb.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/netdb.h b/include/netdb.h index 93e0ebae4718..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 3493 */ +#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 3493 */ +#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 /*