aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authordanrl <mail@danrl.com>2017-02-24 15:07:50 +0100
committerdanrl <mail@danrl.com>2017-02-27 20:44:33 +0100
commit7a255f29f1c0762ac771cd4ed71c6e639ecef1d4 (patch)
tree279ec476b869f3c2a7fbd936dd12dbd8b1cd3591 /net
parent4a06ff6872b369d18f516ae6337411d7bdb7a4fa (diff)
net/wireguard: add support for fwmark option
Adds support for the fwmark option. FwMark is a 32-bit fwmark for outgoing packets. If set to 0 or "off", this option is disabled. Signed-off-by: Dan Luedtke <mail@danrl.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireguard/Makefile2
-rw-r--r--net/wireguard/files/wireguard.sh5
2 files changed, 6 insertions, 1 deletions
diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile
index bee9ea5d1..7802d7e71 100644
--- a/net/wireguard/Makefile
+++ b/net/wireguard/Makefile
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=wireguard
PKG_VERSION:=0.0.20170223
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
diff --git a/net/wireguard/files/wireguard.sh b/net/wireguard/files/wireguard.sh
index 2eb30242a..638ddd922 100644
--- a/net/wireguard/files/wireguard.sh
+++ b/net/wireguard/files/wireguard.sh
@@ -22,6 +22,7 @@ proto_wireguard_init_config() {
proto_config_add_int "listen_port"
proto_config_add_int "mtu"
proto_config_add_string "preshared_key"
+ proto_config_add_string "fwmark"
available=1
no_proto_task=1
}
@@ -103,6 +104,7 @@ proto_wireguard_setup() {
config_get addresses "${config}" "addresses"
config_get mtu "${config}" "mtu"
config_get preshared_key "${config}" "preshared_key"
+ config_get fwmark "${config}" "fwmark"
# create interface
ip link del dev "${config}" 2>/dev/null
@@ -125,6 +127,9 @@ proto_wireguard_setup() {
if [ "${preshared_key}" ]; then
echo "PresharedKey=${preshared_key}" >> "${wg_cfg}"
fi
+ if [ "${fwmark}" ]; then
+ echo "FwMark=${fwmark}" >> "${wg_cfg}"
+ fi
config_foreach proto_wireguard_setup_peer "wireguard_${config}"
# apply configuration file