[PATCH v4] wireguard: Make IPv6 addrs available for automatic prefix assignment

Daniel Gröber dxld at darkboxed.org
Tue Dec 8 18:39:27 EST 2020


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 <dxld at darkboxed.org>
---
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##*/}"
-- 
2.20.1




More information about the openwrt-devel mailing list