From nobody Mon Jul 21 02:13:59 2025 X-Original-To: dev-commits-src-branches@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 4blkV03ryLz61y0N; Mon, 21 Jul 2025 02:14:00 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blkV00SYBz3NjR; Mon, 21 Jul 2025 02:14:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753064040; 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=50quHk369p6oZ0MOB7Lwx6BtgloIApUAXxkIVLv2tyg=; b=ADTGaJkGiXONZbR5spUFSCNB5SCgifiCd2icht0iTnIRg6AdrIFA0h360s+8WVR4AHRsJa PRb5TQsoitlEoIQeDnDIkAbmV2PrvanEqxPW2e9xEUWeGvQNrzDg4NE6pTrff80RVfAYdD 5Zy9aRAD1B/a5a27IiNsUWZzPXNLFVIvvKNX6bb32ddZhIMnJrxqTH2GtThDkMoQf/+woM wSQD2vMefmeMo2lfYSTKeAT2tQT6e1lyEp58iVGQ+dIa5WIqCe6N8UXyaQv1TXfK0VMT7z 0oTbnIYd2E6VM//LPsoD6yVsvYZFgyghgTJLxcKw1G899q1SGFCrzlOCv0fwOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753064040; 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=50quHk369p6oZ0MOB7Lwx6BtgloIApUAXxkIVLv2tyg=; b=CE9r96Gu1RPhRnMCwjPygfOs8eTsQfeylHEAanJWZ6CXkTDjSVELCyoEIvVjf4ZXlLBsHV 6EzzntZ/vaxFf/RzPoqv41GC2TEJijfWc2UvHoSd9eWTy+ig0UE+Lv9m9uB8SrdUI2dk94 KnoWtG4umCVas+vzxJjGXAasmCyoTUGKYIx8ZE0UjXl+erdI+ZBBbfbHBzOxmoAYps0pqj QugSc6WOjpLqsHpdJaCg0dioNzpnLyY53NOw71OEm4YHn+0HGwXay7MeiHJWNjJ/15OEm2 kvbRaJA9Lh51JGVGSex5dAmE4IBai0ZDwtlXhXK8BDZvudWdP5WbDYesYKJf4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753064040; a=rsa-sha256; cv=none; b=qokgJSETCT+vKsJSTVKv9RrFn63Doh1qZNdCZMu2nymjtvM9aQ9tNb7Vf8Gx9/2JXZPHTQ Ujf5xeyPJTmyRZ9R2vaKpa7JWphAZO+mytcxxA3Sv4/qgE6hpxeQ2uphWkkMIunnRkxbig I6tAsUrp5gqhpNsvTTzNvlPSwey7hduviqItq40Y51oTmCzE4oqqAr0q1y9OZFJMskiPHp YN1CZB5KWa/GKXGp+sLNFY6XGqoFgXJHMKHa2u9JSLhjU9fC56VXveyioxGb2W3mdX4JYO eVnFpjr3mP90XMSKKg5MvoF+u7L01mTZg9gASRtqXzfDumTZw9zol8rDKzhG7g== 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 4blkTz752ZzfcF; Mon, 21 Jul 2025 02:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56L2DxcT013982; Mon, 21 Jul 2025 02:13:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56L2DxCa013979; Mon, 21 Jul 2025 02:13:59 GMT (envelope-from git) Date: Mon, 21 Jul 2025 02:13:59 GMT Message-Id: <202507210213.56L2DxCa013979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: e95cf8b04b47 - stable/14 - wg: ipc: add allowed-ip flags support for FreeBSD List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e95cf8b04b47ee9abf544bb754452e6f30b2dc18 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e95cf8b04b47ee9abf544bb754452e6f30b2dc18 commit e95cf8b04b47ee9abf544bb754452e6f30b2dc18 Author: Kyle Evans AuthorDate: 2025-06-26 02:57:03 +0000 Commit: Kyle Evans CommitDate: 2025-07-21 02:13:15 +0000 wg: ipc: add allowed-ip flags support for FreeBSD For $reasons, we can't rely on flags in wireguard-tools for the kernel side of WireGuard. Provide a mapping function that uses flags from the kernel that we're building against and fail the operation if we made it to the end without turning some wg(8) flag off. Signed-off-by: Kyle Evans Reviewed by: ivy (previous version), Jason A. Donenfeld, jhb (cherry picked from commit f6d9e22982a1d0354c0199e94ebdb4474eaa74b9) --- contrib/wireguard-tools/ipc-freebsd.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/contrib/wireguard-tools/ipc-freebsd.h b/contrib/wireguard-tools/ipc-freebsd.h index 58e5e71ce5cb..69077038a15a 100644 --- a/contrib/wireguard-tools/ipc-freebsd.h +++ b/contrib/wireguard-tools/ipc-freebsd.h @@ -307,11 +307,8 @@ static int kernel_set_device(struct wgdevice *dev) nvl_aips[j] = nvlist_create(0); if (!nvl_aips[j]) goto err_peer; - if (aip->flags) { - //TODO: implement me - ret = -EOPNOTSUPP; - goto err_peer; - } + if (aip->flags) + nvlist_add_number(nvl_aips[j], "flags", aip->flags); nvlist_add_number(nvl_aips[j], "cidr", aip->cidr); if (aip->family == AF_INET) nvlist_add_binary(nvl_aips[j], "ipv4", &aip->ip4, sizeof(aip->ip4));