From owner-svn-src-stable-12@freebsd.org Mon Jan 28 02:26:07 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1F7214C5BB1; Mon, 28 Jan 2019 02:26:06 +0000 (UTC) (envelope-from pfg@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 777D86B194; Mon, 28 Jan 2019 02:26:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68DDE190ED; Mon, 28 Jan 2019 02:26:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0S2Q6iA022232; Mon, 28 Jan 2019 02:26:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0S2Q5JA022230; Mon, 28 Jan 2019 02:26:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201901280226.x0S2Q5JA022230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 28 Jan 2019 02:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343519 - in stable/12: include lib/libc/net X-SVN-Group: stable-12 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in stable/12: include lib/libc/net X-SVN-Commit-Revision: 343519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 777D86B194 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 02:26:07 -0000 Author: pfg Date: Mon Jan 28 02:26:05 2019 New Revision: 343519 URL: https://svnweb.freebsd.org/changeset/base/343519 Log: MFC r342379, r342383: gai_strerror() - Update string error messages according to RFC 3493. Error messages in gai_strerror(3) vary largely among OSs. For new software we largely replaced the obsoleted EAI_NONAME and with EAI_NODATA but we never updated the corresponding message to better match the intended use. We also have references to ai_flags and ai_family which are not very descriptive for non-developer end users. Bring new error messages based on informational RFC 3493, which has obsoleted RFC 2553, and make them consistent among the header and manpage. Modified: stable/12/include/netdb.h stable/12/lib/libc/net/gai_strerror.3 stable/12/lib/libc/net/gai_strerror.c Directory Properties: stable/12/ (props changed) Modified: stable/12/include/netdb.h ============================================================================== --- stable/12/include/netdb.h Mon Jan 28 02:15:41 2019 (r343518) +++ stable/12/include/netdb.h Mon Jan 28 02:26:05 2019 (r343519) @@ -159,24 +159,24 @@ struct addrinfo { #define NO_ADDRESS NO_DATA /* no address, look for MX record */ /* - * Error return codes from getaddrinfo() + * Error return codes from gai_strerror(3), see RFC 3493. */ #if 0 -/* obsoleted */ +/* Obsoleted on RFC 2553bis-02 */ #define EAI_ADDRFAMILY 1 /* address family for hostname not supported */ #endif -#define EAI_AGAIN 2 /* temporary failure in name resolution */ -#define EAI_BADFLAGS 3 /* invalid value for ai_flags */ +#define EAI_AGAIN 2 /* name could not be resolved at this time */ +#define EAI_BADFLAGS 3 /* flags parameter had an invalid value */ #define EAI_FAIL 4 /* non-recoverable failure in name resolution */ -#define EAI_FAMILY 5 /* ai_family not supported */ +#define EAI_FAMILY 5 /* address family not recognized */ #define EAI_MEMORY 6 /* memory allocation failure */ #if 0 -/* obsoleted */ +/* Obsoleted on RFC 2553bis-02 */ #define EAI_NODATA 7 /* no address associated with hostname */ #endif -#define EAI_NONAME 8 /* hostname nor servname provided, or not known */ -#define EAI_SERVICE 9 /* servname not supported for ai_socktype */ -#define EAI_SOCKTYPE 10 /* ai_socktype not supported */ +#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 */ #define EAI_BADHINTS 12 /* invalid value for hints */ #define EAI_PROTOCOL 13 /* resolved protocol is unknown */ Modified: stable/12/lib/libc/net/gai_strerror.3 ============================================================================== --- stable/12/lib/libc/net/gai_strerror.3 Mon Jan 28 02:15:41 2019 (r343518) +++ stable/12/lib/libc/net/gai_strerror.3 Mon Jan 28 02:26:05 2019 (r343519) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 21, 2006 +.Dd December 23, 2018 .Dt GAI_STRERROR 3 .Os .Sh NAME @@ -44,38 +44,30 @@ The following error codes and their meaning are define .Pp .Bl -tag -width ".Dv EAI_BADFLAGS" -offset indent -compact .It Dv EAI_AGAIN -temporary failure in name resolution +Name could not be resolved at this time .It Dv EAI_BADFLAGS -invalid value for -.Fa ai_flags +flags parameter had an invalid value .It Dv EAI_BADHINTS invalid value for .Fa hints .It Dv EAI_FAIL -non-recoverable failure in name resolution +Non-recoverable failure in name resolution .It Dv EAI_FAMILY -.Fa ai_family -not supported +Address family was not recognized .It Dv EAI_MEMORY -memory allocation failure +Memory allocation failure .It Dv EAI_NONAME -.Fa hostname -or -.Fa servname -not provided, or not known +Name does not resolve .It Dv EAI_OVERFLOW argument buffer overflow .It Dv EAI_PROTOCOL -resolved protocol is unknown +Resolved protocol is unknown .It Dv EAI_SERVICE -.Fa servname -not supported for -.Fa ai_socktype +Service was not recognized for socket type .It Dv EAI_SOCKTYPE -.Fa ai_socktype -not supported +Intended socket type was not recognized .It Dv EAI_SYSTEM -system error returned in +System error returned in .Va errno .El .Sh RETURN VALUES @@ -90,3 +82,8 @@ is out of range, an implementation-specific error mess .Sh SEE ALSO .Xr getaddrinfo 3 , .Xr getnameinfo 3 +.Sh STANDARDS +.Bl -tag -width ".It RFC 2743" +.It RFC 3493 +Basic Socket Interface Extensions for IPv6 +.El Modified: stable/12/lib/libc/net/gai_strerror.c ============================================================================== --- stable/12/lib/libc/net/gai_strerror.c Mon Jan 28 02:15:41 2019 (r343518) +++ stable/12/lib/libc/net/gai_strerror.c Mon Jan 28 02:26:05 2019 (r343519) @@ -45,19 +45,19 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" /* Entries EAI_ADDRFAMILY (1) and EAI_NODATA (7) are obsoleted, but left */ -/* for backward compatibility with userland code prior to 2553bis-02 */ +/* for backwards compatibility with userland code prior to RFC2553bis-02 */ static const char *ai_errlist[] = { "Success", /* 0 */ - "Address family for hostname not supported", /* 1 */ - "Temporary failure in name resolution", /* EAI_AGAIN */ - "Invalid value for ai_flags", /* EAI_BADFLAGS */ + "Address family for hostname not supported", /* 1: Obsolete */ + "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 */ - "ai_family not supported", /* EAI_FAMILY */ + "Address family not recognized", /* EAI_FAMILY */ "Memory allocation failure", /* EAI_MEMORY */ - "No address associated with hostname", /* 7 */ - "hostname nor servname provided, or not known", /* EAI_NONAME */ - "servname not supported for ai_socktype", /* EAI_SERVICE */ - "ai_socktype not supported", /* EAI_SOCKTYPE */ + "No address associated with hostname", /* 7: Obsolete*/ + "Name does not resolve", /* EAI_NONAME */ + "Service was not recognized for socket type", /* EAI_SERVICE */ + "Intended socket type was not recognized", /* EAI_SOCKTYPE */ "System error returned in errno", /* EAI_SYSTEM */ "Invalid value for hints", /* EAI_BADHINTS */ "Resolved protocol is unknown", /* EAI_PROTOCOL */