From nobody Mon Apr 01 17:23:47 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 4V7dCR4mTCz5GSp2; Mon, 1 Apr 2024 17:23:47 +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 4V7dCR4CWRz4ftf; Mon, 1 Apr 2024 17:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711992227; 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=ejatPFrOKIgLF+Ca0Tmtbmp1R2cISRnN6ZubXmYYwDU=; b=vJaD3nP/4TfC73c+HaR1rP9wVbs0DyqQlhkymWviH3KmahzUulYZdzN/10iUe02htGU3nT 7OFNuPZraEqHFxtD/IH24O7F0zBUPIDbf4c5lz/nh10mxxMe70mIFpqmmp9/RLKr64p1+o P3tcIyZjkTBcvxBdb5KGYPowB3VWzsRqXmhse/SaIW3gN/gMGbsbLnZdq2O0eDJrw0Be9L QcABQ+NMZnOUoeWyztDzKhy8ICcN6drihM92FJAHnthJthfHY906kBZqbyW4PeV8mbMiqX LMSBP/VBUBalzR3JjaJ5V1TU3lu5jeM031B/i8JiOzD93IIMyCZvV/gNxyJIpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711992227; a=rsa-sha256; cv=none; b=mz8DiUdnDVNGVN4ICDyRNZV25QlD/8dQwf04QpqMU1CUbabCAcVlc3gtgPFURGfyN+lDnJ SIHePFs0yEFd/mVXICthuPvbpH7dfuFAK9UwcM9/RieWPluBRFUjb523pBNbc4uAJ9Eg+e f0VGFl/a7p3W8izosQ6Hq2EKa8mGGPe8VTDcC97btZlzeIiwGDFXmplrTbA1yPT1x9/kXx XQ8nhgXeMa/zhYn497WKstv1HH7khe20i4YDY8ZaP2DMmVR4kE23WdmPdYCu21WTAtMfGd jVMnDt/DWisr9/XPsNgcH3kVlUJTL57VuCsyD2mzdvqlHmByiVVQgu5RqR0YfQ== 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=1711992227; 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=ejatPFrOKIgLF+Ca0Tmtbmp1R2cISRnN6ZubXmYYwDU=; b=uwsMYZaXrfwwpZwuFju4xlOtJJRNDZ3eUzbkVi/rPdsCrNX5c5ktsogSAsiDc/BDY+VDSE WqUJYPJjxSrc2hnR/9a9bJhbqpL4O6GGKJLoNQv5MqIXeypdHjh03KKZ4EGzqmfF7JfXZw sTCqLpBLHFXU8mRnAdkPsqS+1PGXRUw4QtGL6bfb6P5ewOYOuMLX+M1YyKd2s30E51bbeY 3KaMazSJh/7vQYrx1s4w17TiPXDqTYUQUOXfDsEPEArBywNDoh4TF9fP9/CeQWkzn5zP4f E3M/PVKmlAiylibElVOz1sx77ybx22MkWjaSM9ylFjfIcvJXn0YA76Rrm1efeg== 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 4V7dCR3lm4zDyX; Mon, 1 Apr 2024 17:23:47 +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 431HNljG040125; Mon, 1 Apr 2024 17:23:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431HNlNf040122; Mon, 1 Apr 2024 17:23:47 GMT (envelope-from git) Date: Mon, 1 Apr 2024 17:23:47 GMT Message-Id: <202404011723.431HNlNf040122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 63613e3ba1e1 - main - 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: 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63613e3ba1e188e9fece43e1613bd697f04b345e Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=63613e3ba1e188e9fece43e1613bd697f04b345e commit 63613e3ba1e188e9fece43e1613bd697f04b345e Author: Mark Johnston AuthorDate: 2024-04-01 17:20:55 +0000 Commit: Mark Johnston CommitDate: 2024-04-01 17:23:32 +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 --- 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 42c426ac1819..bb61917ee4fc 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) @@ -2115,7 +2112,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; }