wireguard-tools: add tunlink option for hostroute
authorAaron Goodman <aaronjg@stanford.edu>
Thu, 27 Aug 2020 01:27:40 +0000 (21:27 -0400)
committerHans Dedecker <dedeckeh@gmail.com>
Sun, 30 Aug 2020 19:47:13 +0000 (21:47 +0200)
In a multi-wan setup, netifd may need guidance on which wan device to
use to create the route to the remote peer.

This commit adds a 'tunlink' option similar to other tunneling interfaces
such as 6in4, 6rd, gre, etc.

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
package/network/utils/wireguard-tools/Makefile
package/network/utils/wireguard-tools/files/wireguard.sh

index 2137a8b4a1aa7a1e877a6b06ce2160007cdec1b9..fb7c0b6ee6c4173bde9af0bad748b1a469098512 100644 (file)
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/kernel.mk
 PKG_NAME:=wireguard-tools
 
 PKG_VERSION:=1.0.20200513
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=wireguard-tools-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-tools/snapshot/
index ccac34e45fa1e03183432795b26af3b822f2b2f5..63261aea71daa058bf37014ba7d670a5e74a2e04 100644 (file)
@@ -112,6 +112,7 @@ proto_wireguard_setup() {
        config_get fwmark "${config}" "fwmark"
        config_get ip6prefix "${config}" "ip6prefix"
        config_get nohostroute "${config}" "nohostroute"
+       config_get tunlink "${config}" "tunlink"
 
        ip link del dev "${config}" 2>/dev/null
        ip link add dev "${config}" type wireguard
@@ -173,7 +174,7 @@ proto_wireguard_setup() {
                sed -E 's/\[?([0-9.:a-f]+)\]?:([0-9]+)/\1 \2/' | \
                while IFS=$'\t ' read -r key address port; do
                        [ -n "${port}" ] || continue
-                       proto_add_host_dependency "${config}" "${address}"
+                       proto_add_host_dependency "${config}" "${address}" "${tunlink}"
                done
        fi