From patchwork Tue Dec 8 23:39:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_Gr=C3=B6ber?= X-Patchwork-Id: 1413090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=darkboxed.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=g6AUy09R; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CrGxd3jZ5z9sVk for ; Wed, 9 Dec 2020 10:44:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=O74fFHs9yCkG1YAwXQ3rEtO21KMoqCN8LljRZbN8yeo=; b=g6AUy09RxsUzoYTq9M644vcvIP zqP+PtgzpI07Us+0BcYwUxmubueLnQtetwAGKubgnp6PUw6+MfT0yVqto5iJuXtAyd3djl2zbcNVh jfSEhUT75F4CgcU27eZQmIwrYBJ+eAudFUiGtFyN76vp+LEcJnwY1WqZ5yIDG//dEwvSrl+KJ8Z7t g/Up2cCPlmUXeLLDnHMokrMhJdmljzmk/+q8PdcK4MoYEa9VVLjfYTNdJozJ8Mrej6fWQNpaZoe2n FxBfkRftt77QXgCWeIKqaAF4/qaJZlhDy1WY+5IsoGb8BWhQgBjg6dHdwMGxZ6m3/+blXQuPvpwWS v7hpi1Jw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmmcv-0004tx-Ul; Tue, 08 Dec 2020 23:42:37 +0000 Received: from janet.servers.dxld.at ([2a01:4f8:201:89f4::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmmct-0004t4-8w for openwrt-devel@lists.openwrt.org; Tue, 08 Dec 2020 23:42:36 +0000 Received: janet.servers.dxld.at; Wed, 09 Dec 2020 00:42:30 +0100 From: =?utf-8?q?Daniel_Gr=C3=B6ber?= To: openwrt-devel@lists.openwrt.org Subject: [PATCH v4] wireguard: Make IPv6 addrs available for automatic prefix assignment Date: Wed, 9 Dec 2020 00:39:27 +0100 Message-Id: <20201208233927.15298-1-dxld@darkboxed.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Spam-score: -1.9 X-Spam-bar: - X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201208_184235_333124_5B4CB423 X-CRM114-Status: UNSURE ( 9.21 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Currently when assigning IPv6 addresses with large prefixes to a wireguard interface, like config interface 'wg' option proto 'wireguard' list addresses 'fd::/48' and having, say, a LAN interface such as config interface 'lan' option proto 'static' option ip6assign '60' as is default the interface does not automatically receive the wg interface's prefix. For this to happen the proto needs to use proto_add_ipv6_prefix to register the fact that a prefix is available for assignment which is simple enough. Signed-off-by: Daniel Gröber --- v4: Remove note about netifd incompatibility as master already has the fix. package/network/utils/wireguard-tools/Makefile | 2 +- package/network/utils/wireguard-tools/files/wireguard.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package/network/utils/wireguard-tools/Makefile b/package/network/utils/wireguard-tools/Makefile index 3cdbaa785c..c42ea4f492 100644 --- a/package/network/utils/wireguard-tools/Makefile +++ b/package/network/utils/wireguard-tools/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard-tools PKG_VERSION:=1.0.20200827 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=wireguard-tools-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-tools/snapshot/ diff --git a/package/network/utils/wireguard-tools/files/wireguard.sh b/package/network/utils/wireguard-tools/files/wireguard.sh index 63261aea71..a18d09eaed 100644 --- a/package/network/utils/wireguard-tools/files/wireguard.sh +++ b/package/network/utils/wireguard-tools/files/wireguard.sh @@ -151,6 +151,7 @@ proto_wireguard_setup() { case "${address}" in *:*/*) proto_add_ipv6_address "${address%%/*}" "${address##*/}" + proto_add_ipv6_prefix "${address}" ;; *.*/*) proto_add_ipv4_address "${address%%/*}" "${address##*/}"