From nobody Wed Nov 02 16:04:29 2022 X-Original-To: dev-commits-src-main@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 4N2Wt55l7Yz4gGBt; Wed, 2 Nov 2022 16:04:29 +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 4N2Wt5569Jz3gK8; Wed, 2 Nov 2022 16:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667405069; 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=nd6/ExriJMSfWr8w7dUgYAMmH3usjORQ4Wen6zjczeY=; b=X++5+vXNQ4Ohm1t9aKnszR6zCcrf9R5kqUeE2i0nHw1GH85AxUTtkYKpYBH4ki2RiWIH5F LyyNNpRrQYPIsLSdbp04r1uN0xJGOtgvvFmSxbv4r0tGo2TL2PJxULH0+Pj+v2s5FMekoY W9QOG6n2ZcOCyxes1yU5MqKiEdYgTS5q0iRzhsrOtFaqtPichNGd8SCufjtye7SCIywyTv 9Syk5+6jO5uWkxDWjVr9u0ZFxukEb9F69554rIe9BCUy0IPDaVQhMMKL8Cuz5Eu7iXMhr2 7B+5bv4tmqnj3mcNRSsqjJNRZHkVbu9TNxAxNY4mGHPLEJ31qYhK+ieNrlZjDQ== 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 4N2Wt54ClSz12k8; Wed, 2 Nov 2022 16:04:29 +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 2A2G4TQv080095; Wed, 2 Nov 2022 16:04:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A2G4TRq080094; Wed, 2 Nov 2022 16:04:29 GMT (envelope-from git) Date: Wed, 2 Nov 2022 16:04:29 GMT Message-Id: <202211021604.2A2G4TRq080094@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: e34adc71d372 - main - gai_strerror.[c3]: re-enable EAI_ADDRFAMILY, EAI_NODATA List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: e34adc71d3724a8b1add483310efbc63db9290a6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667405069; 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=nd6/ExriJMSfWr8w7dUgYAMmH3usjORQ4Wen6zjczeY=; b=N7SWur6ycFc7bFc1cuLJBfZ62O6/TyRZNShBnLLQtO9REx1fxlwNK7a0e8lwpJ4FRseugM QrFV2ci2BMFFkRPKzHLxUb6+nxCWY75wkua94l6AyVNgBE8VxUqxmsgYP4ebQ0+5n/FNMW QgGtwAsmFCH702YmF9KaQYYF4buygq7qXyWRCP7ELawecvaOAlF+3gH1PwieKQp3u3bcT4 xUnTCsEExta0glRiwMNV05zlqVUzfMtnq5/+L0VGOZyBWbxdVX2ZEfiaReYeOaqsXRg3zz 7qu6FvGtbTRkLjnqqizjw/Bn2usU7G/IlAv5+8YfH/+n7klJ+N8PZb0KUqrLuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667405069; a=rsa-sha256; cv=none; b=i1X7PoT1jzxd9ImR3scMZPHGLUhNbjMvphg+LuwI/l+0p/CL9uhMdT+qAlJKWFcOuiOPNL ipWakNM9o2+l+0AJ4Sbm/EbsHhiE2uA6D4BWL3vOLUQJI5+Cg1zz92PQwEv8YwNw0nvkbE CK5YO2QHGkj+9Aqc2LUOeqNUJSKY05qtxaZhAO/aX7r+mNUWEvQO20Q9nc/bxaC/bS3AGb NowXooYMB01h2PlQhnsL4G8BoSL1HWPcxVS9vZYJGp78P2roMwk7xeBYJaLol921lalWfV CEPzIrVk6Ao7ZsritY7je2WWxBMU9j/YujuDQ4J4igH5AuSIhOTd/hLojzpedg== 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=e34adc71d3724a8b1add483310efbc63db9290a6 commit e34adc71d3724a8b1add483310efbc63db9290a6 Author: Mike Karels AuthorDate: 2022-11-02 15:55:32 +0000 Commit: Mike Karels CommitDate: 2022-11-02 16:03:31 +0000 gai_strerror.[c3]: re-enable EAI_ADDRFAMILY, EAI_NODATA gai_strerror.c still has messages for EAI_ADDRFAMILY and EAI_NODATA, but not the man page. Re-add to the man page, and update comments in the source. Document the errors that are not in RFC 3493 or POSIX. Reviewed in https://reviews.freebsd.org/D37139 with related changes. Reviewed by: bz, pauamma MFC after: 1 month --- lib/libc/net/gai_strerror.3 | 17 ++++++++++++++--- lib/libc/net/gai_strerror.c | 10 ++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lib/libc/net/gai_strerror.3 b/lib/libc/net/gai_strerror.3 index d948083447db..2653fc6d371a 100644 --- a/lib/libc/net/gai_strerror.3 +++ b/lib/libc/net/gai_strerror.3 @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2018 +.Dd November 2, 2022 .Dt GAI_STRERROR 3 .Os .Sh NAME @@ -42,7 +42,9 @@ or The following error codes and their meaning are defined in .In netdb.h : .Pp -.Bl -tag -width ".Dv EAI_BADFLAGS" -offset indent -compact +.Bl -tag -width ".Dv EAI_ADDRFAMILY" -offset indent -compact +.It Dv EAI_ADDRFAMILY +Address family for hostname not supported .It Dv EAI_AGAIN Name could not be resolved at this time .It Dv EAI_BADFLAGS @@ -56,6 +58,8 @@ Non-recoverable failure in name resolution Address family was not recognized .It Dv EAI_MEMORY Memory allocation failure +.It Dv EAI_NODATA +No address associated with hostname .It Dv EAI_NONAME Name does not resolve .It Dv EAI_OVERFLOW @@ -83,7 +87,14 @@ is out of range, an implementation-specific error message string is returned. .Xr getaddrinfo 3 , .Xr getnameinfo 3 .Sh STANDARDS -.Bl -tag -width ".It RFC 2743" +.Bl -tag -width ".It RFC 3493" .It RFC 3493 Basic Socket Interface Extensions for IPv6 .El +.Pp +EAI_ADDRFAMILY and EAI_NODATA were in previous RFCs, but not in RFC 3493. +They are not in POSIX (IEEE Std 1003.1-2017). +They were in +.Fx +before 5.2, and were re-added for 14.0. +EAI_BADHINTS, EAI_OVERFLOW, and EAI_PROTOCOL are not in RFC 3493 or POSIX. diff --git a/lib/libc/net/gai_strerror.c b/lib/libc/net/gai_strerror.c index f168c3093735..276ba91b95fd 100644 --- a/lib/libc/net/gai_strerror.c +++ b/lib/libc/net/gai_strerror.c @@ -44,17 +44,19 @@ __FBSDID("$FreeBSD$"); #endif #include "un-namespace.h" -/* Entries EAI_ADDRFAMILY (1) and EAI_NODATA (7) are obsoleted, but left */ -/* for backwards compatibility with userland code prior to RFC2553bis-02 */ +/* + * Entries EAI_ADDRFAMILY (1) and EAI_NODATA (7) were omitted from RFC 3493, + * but are or may be used as extensions or in old code. + */ static const char *ai_errlist[] = { "Success", /* 0 */ - "Address family for hostname not supported", /* 1: Obsolete */ + "Address family for hostname not supported", /* EAI_ADDRFAMILY */ "Name could not be resolved at this time", /* EAI_AGAIN */ "Flags parameter had an invalid value", /* EAI_BADFLAGS */ "Non-recoverable failure in name resolution", /* EAI_FAIL */ "Address family not recognized", /* EAI_FAMILY */ "Memory allocation failure", /* EAI_MEMORY */ - "No address associated with hostname", /* 7: Obsolete*/ + "No address associated with hostname", /* EAI_NODATA*/ "Name does not resolve", /* EAI_NONAME */ "Service was not recognized for socket type", /* EAI_SERVICE */ "Intended socket type was not recognized", /* EAI_SOCKTYPE */