From nobody Tue Mar 12 19:40:53 2024 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 4TvPBs2vnlz5FMmg; Tue, 12 Mar 2024 19:40:53 +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 4TvPBs2SgQz4PKt; Tue, 12 Mar 2024 19:40:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710272453; 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=WB3/CPyEZ+AOqtLA1J06+qr14R/ndzNSArEZITTx6p0=; b=Gd6fOkFAvRov9J25Bmg5rYxoCdRgvWL9YTfiTWcu6xipZJbmL7HJg13EIYg1zh9wEuo4Hx nAqKnnF4Jk4l+Tzvj8ijL90HslSpjjzAOz6JW1XUgdX27TyteU2KydFCTvAUTc9uDf8H62 FIm5NAYo2q/TlIWFeqFIiEEgyCXJ1hfe6wzzzKwgiD567tjZgHkUF3bTNKj27ON2Ygen7/ 7ynJ+linHmq7HwdeRutCiPgm0Wv5BF2gAKxpKiDPT5AUOyNEH1EF3AQMYHIi1WzgPw5UYe KkrzNEEaHgkyCtYffeD4JW9YcTlqABZ19Kxx77yjIhpZcRI0NrxOaQY8BSVhFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710272453; a=rsa-sha256; cv=none; b=dWM6I23fDdKqqF0E8Pp/8Z/qu1zl3+T7UaD61boHibYy1L5601+Rv2Myvs6A2WKk3KAs9f 0Vaw8hxH40qmoGYR29GZpGobc5PHyVaTqHHwq931r4tTmDvrLfXcskDMB4ohk9xtSyloTA mzhy8aLP+58jtfxRLS4sIB+C6bxY2Rn2S8SluBHAm4ZnINR6ZU1kHGpFLAoEyncnZjma4Z KcJS3IIWlnMT9XI2eAFFyfL4dnu20Wl6Oc11mbDMSGO0hPXtGOEbhSTCOeDvUfh3uhHC3O TuThveVpYg7t3oLRSql/dK/V0WJs4rSRT7Bd0bDdUP7SAtmW2Keo44H0wQBSOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710272453; 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=WB3/CPyEZ+AOqtLA1J06+qr14R/ndzNSArEZITTx6p0=; b=t6boIZxn5TdenKcv/RbTGaa/Mma64go+S318d9G4gmhtjsnVmdcEEiGSmkeL1dSi/R4AY6 I/G2fyBI/Yrabk5ocKSwWCL/lpGycPiYhrLUsTPA3QiC7IeUxKJE2cyfdFK/NvYFwsl3ar TTugwSwBOId/ZZPfQlC55rmiMdbyBlyB9KSveEc7TDiD8e4StuL207RugCMxvkRhJTZQs+ LwapO9XHJ7+SD7oZFd3FbOf2TpNfRYdnnD4s8H3aVtZL3eP7BVhxU/3zzZuytGgN8QnJ16 YHCmf8HX0H1WRi34GIkv9VUzQO+iSyFGwuGqTiwpuymhPz+Fmz1cSgwjzMwJqA== 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 4TvPBs24rmz1RBy; Tue, 12 Mar 2024 19:40:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42CJere3084307; Tue, 12 Mar 2024 19:40:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42CJerAw084304; Tue, 12 Mar 2024 19:40:53 GMT (envelope-from git) Date: Tue, 12 Mar 2024 19:40:53 GMT Message-Id: <202403121940.42CJerAw084304@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: b53ae8a8333d - main - ping: Fix protocol selection with NOINET6 kernel. 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: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b53ae8a8333d730bb977276c511743b98c881423 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b53ae8a8333d730bb977276c511743b98c881423 commit b53ae8a8333d730bb977276c511743b98c881423 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-12 19:40:36 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-12 19:40:36 +0000 ping: Fix protocol selection with NOINET6 kernel. A missing else caused the correct resolver hint (AF_INET) to be overwritten with AF_UNSPEC when the kernel supports IPv4 but not IPv6. MFC after: 3 days PR: 277592 Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44304 --- sbin/ping/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ping/main.c b/sbin/ping/main.c index 1d1816361788..8a572cb3c914 100644 --- a/sbin/ping/main.c +++ b/sbin/ping/main.c @@ -149,7 +149,7 @@ main(int argc, char *argv[]) hints.ai_socktype = SOCK_RAW; if (feature_present("inet") && !feature_present("inet6")) hints.ai_family = AF_INET; - if (feature_present("inet6") && !feature_present("inet")) + else if (feature_present("inet6") && !feature_present("inet")) hints.ai_family = AF_INET6; else hints.ai_family = AF_UNSPEC;