From nobody Mon Apr 15 14:05:37 2024 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 4VJ88L4Wlzz5GfdQ; Mon, 15 Apr 2024 14:05:38 +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 4VJ88L0j8Gz4WY2; Mon, 15 Apr 2024 14:05:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713189938; 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=GGKPlGkIAMuzz3LWzLjjvoOZNT1TlIQuL4if/jhN5sU=; b=KI66ZOPnlGDzhXv58AS55shzGXRV8tS7VHQlMpfLEjxYGcRiqTPGTJ85GrojNVRggtiEnR 9KegSQruFxcMyWGUu7B3oCiFeSBlb4PSmKKPTwiVhTBMrorrwGOe2aBJScrZo1OnXr/LMw dQ+TrIMHAOEkSI40vdjjkeC8Ooqta0XsZB+X482xliz5yDimEKT4MMpSqBj5TaLROR9kwI BvgQeepntUsTh43lVI7SmLhkYExt/OkGmJGiV57QHivr5AOF9/Bu9MSIHx7CFATZmLHWYl 4EfNIXurClMWLn+OiRX7XfD4qAkByGU5CQH80R1SmFHPCfc0u+wG2efqf63MRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713189938; a=rsa-sha256; cv=none; b=wpLTouXc8uzDTFxY5J70otApqiTW/GryqzVzxDDT0E4xeLYQBOrQi8Z2lsCey02Fzq8/me IrqNLEnfLBFW74C2bjU5d52zT1RXKMuxJw5oedjpWuno1FKjWLjVuBKWGQn+o49RaYoiDA BaGxefNm0eD/xtNUaHjyHvjd+1kGWerbZOTYf15BXusvV+El71r32DjW3LbAf4j1qxEdYt 3AKgYsWu7TLMyJD2DjRWIthosfFG85vCQJYyQzrKEemj+oSmBSujc1+fzq79w0W8kZy4UV I/fwG3iNi1DrIgKlZPS0VpvUjb/9A9W+ovSauKJmtXFO9OsL6QwaHCUvyPCErQ== 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=1713189938; 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=GGKPlGkIAMuzz3LWzLjjvoOZNT1TlIQuL4if/jhN5sU=; b=Br+4EOUjaPf0FaNI0caC9X4E2b2lwAIjydsWF+iu6dAcos/9rEnfJD5vzQt3CG5smGUR5b EfCGDCYS3YTWBea37952X8TKgNdTPHAPmP29EKV7+nB2TQjqWZ6UsOVFYDgvzHybGifgpF Ym+MJzr2JCrc37UtHIgyjhO0BafsUSkcn4eD36ch4XaODgf/ExBaPX/9D9eOEcLpXQJipV aacYqq2ScgI7KamR5PDH616I+LD3Qxize8P9/ow4yyJG3yiGiJBQ0KcwTx0cYHRfHw5sek BIx7LDzrhLbXTiMrYDM2o3f5bVo2+ULMZmi/UURTp+DbgWiH5gB+AKuZi0IBaw== 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 4VJ88L0KM3z136Z; Mon, 15 Apr 2024 14:05:38 +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 43FE5bN9070302; Mon, 15 Apr 2024 14:05:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43FE5blB070299; Mon, 15 Apr 2024 14:05:37 GMT (envelope-from git) Date: Mon, 15 Apr 2024 14:05:37 GMT Message-Id: <202404151405.43FE5blB070299@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 14148b5c5cd6 - stable/14 - wg: Use ENETUNREACH when transmitting to a non-existent peer 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 14148b5c5cd602f57a7536fe295632173939380e Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=14148b5c5cd602f57a7536fe295632173939380e commit 14148b5c5cd602f57a7536fe295632173939380e Author: Mark Johnston AuthorDate: 2024-04-01 17:20:55 +0000 Commit: Mark Johnston CommitDate: 2024-04-15 14:05:13 +0000 wg: Use ENETUNREACH when transmitting to a non-existent peer The old errno value used is specifically for Capsicum and shouldn't be co-opted in this way. It has special handling in the generic syscall layer (see syscallret()). OpenBSD returns ENETUNREACH in this case; let's do the same thing. Reviewed by: kevans, imp MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D44582 (cherry picked from commit 63613e3ba1e188e9fece43e1613bd697f04b345e) --- sys/dev/wg/if_wg.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index 25fa53c2e672..bf4eef31c0b3 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -251,9 +251,6 @@ struct wg_softc { #define MAX_LOOPS 8 #define MTAG_WGLOOP 0x77676c70 /* wglp */ -#ifndef ENOKEY -#define ENOKEY ENOTCAPABLE -#endif #define GROUPTASK_DRAIN(gtask) \ gtaskqueue_drain((gtask)->gt_taskqueue, &(gtask)->gt_task) @@ -2113,7 +2110,7 @@ wg_xmit(if_t ifp, struct mbuf *m, sa_family_t af, uint32_t mtu) BPF_MTAP2_AF(ifp, m, pkt->p_af); if (__predict_false(peer == NULL)) { - rc = ENOKEY; + rc = ENETUNREACH; goto err_xmit; }