From nobody Wed Nov 02 16:04:31 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 4N2Wt8191Qz4gG54; Wed, 2 Nov 2022 16:04:32 +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 4N2Wt8038Sz3gHg; Wed, 2 Nov 2022 16:04:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667405072; 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=XA7glRgv60mXROp+91J9L/zyWidy0BaFlrO/+wQ2y5Y=; b=U31zWbNKCzdjY0ZciRMldpi804NES10YrHOojPEgedu/dZSN6K7CfO62IY4o9scnq5cZwT puNdoS7piygyg1FLXe5y/g61ChT6XjY326/Km6Y5aY0ygFshAm2Ufu6cFfDVO2ULe8eiJT yKM7fALPKi48kMlX2T170cfIFGg4R1solU+BwIEZqfkgRXnUEt/ok9OJZkvOyKgqZg4qBZ lZKRNHN0VLcIM3ga5yJfjiFYJuZ3g3GTmWj+3gsKKZc7e8Wk837dfujp/F96ZmrqO/sYVM I7p+FtlfZJKGpDnJE/1PQFRo5J8rHmS0y4OFYCG6veKA1vho/v9BasmOQ6mKog== 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 4N2Wt76Gbnz12hc; Wed, 2 Nov 2022 16:04:31 +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 2A2G4VqT080149; Wed, 2 Nov 2022 16:04:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A2G4VLo080148; Wed, 2 Nov 2022 16:04:31 GMT (envelope-from git) Date: Wed, 2 Nov 2022 16:04:31 GMT Message-Id: <202211021604.2A2G4VLo080148@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: 631b82aca0fd - main - fetch: support EAI_ADDRFAMILY error, correct two error messages 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: 631b82aca0fd41c8e0d48eebdb9c4e38b7306472 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667405072; 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=XA7glRgv60mXROp+91J9L/zyWidy0BaFlrO/+wQ2y5Y=; b=iDgrN98ksR5az8xasLStxjyHRGaykdolGrFCS93mhnnZdwj/KDARsrOZHWPZUz1e2oZwcC s/Eca9bd3Tnbe+oX/yykyTS3bxMqCzbshiIRx/FypwQE/wOKrTs58/afpS8j9T7bXYB9G4 nx17sePSLizk/TnJhD3oG/UtsVr3dO0Bbs+VaPeFxuGLSIZJLgBB79l4HXZqe+CvG4kz9K 5pnf/72j4BPJIvEjvSJpIaLymc5eDcdEebNK/26O4a1JOih/CE4qFvMy8r/VZZ3qYOJFm0 ldqYlH3O/3k8LW25okPQueUeHdsZyQI6Qkp8CwIYbc/QciVrA2+LtLMEZY1PYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667405072; a=rsa-sha256; cv=none; b=FWa4Lh0xhfQ7Q/d+nkKDfURi6ym8fjtDOoX4/nWJqzvao1UYn2IwXjFZ7PFnGWEsYd/kpJ fgZ7U9n9V3XhZhjcIi2OiIpECeKidL4RQ76EjIHCnJM9kKigQeM0tIhlGmDlFUxjYO0tA1 nQ0SeSJcb8HmiH0Dh5Gkm+P0JgkkYz4gSj55GMaAXECIrvIrT+QOaT7xm4drin6ZvWQVE/ +bnk3PNGK/3BPCp9elMn9MI/rTO4TILiAbYXkjwiyZYoRmiv18LRD120JZ7Q3IveI+lapf tCZwNuJ+X0pc8yeYxhGZmsng+vX5XbWOtO/O3F00Y0oK6r6UKEWCeqmfP52K3w== 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=631b82aca0fd41c8e0d48eebdb9c4e38b7306472 commit 631b82aca0fd41c8e0d48eebdb9c4e38b7306472 Author: Mike Karels AuthorDate: 2022-11-02 15:59:09 +0000 Commit: Mike Karels CommitDate: 2022-11-02 16:03:31 +0000 fetch: support EAI_ADDRFAMILY error, correct two error messages With the change to return EAI_ADDRFAMILY from getaddrinfo(), fetch would print "Unknown resolver error" for that error. Add that error and its string to libfetch's table, using an #ifdef just in case. Correct error strings for EAI_NODATA (although it is currently unused) and EAI_NONAME. Should maybe rework the code to use gai_strerror(3), but that doesn't map directly, and the current strings are shortened. Reviewed in https://reviews.freebsd.org/D37139 with related changes. Reviewed by: bz MFC after: 1 month --- lib/libfetch/common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index 47545e5178c3..7bf487b0db1d 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -67,12 +67,15 @@ __FBSDID("$FreeBSD$"); * Error messages for resolver errors */ static struct fetcherr netdb_errlist[] = { +#ifdef EAI_ADDRFAMILY + { EAI_ADDRFAMILY, FETCH_RESOLV, "Address family for host not supported" }, +#endif #ifdef EAI_NODATA - { EAI_NODATA, FETCH_RESOLV, "Host not found" }, + { EAI_NODATA, FETCH_RESOLV, "No address for host" }, #endif { EAI_AGAIN, FETCH_TEMP, "Transient resolver failure" }, { EAI_FAIL, FETCH_RESOLV, "Non-recoverable resolver failure" }, - { EAI_NONAME, FETCH_RESOLV, "No address record" }, + { EAI_NONAME, FETCH_RESOLV, "Host does not resolve" }, { -1, FETCH_UNKNOWN, "Unknown resolver error" } };