aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/wireguard
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2019-03-27 22:59:03 +0100
committerDaniel Golle <daniel@makrotopia.org>2019-03-27 22:59:03 +0100
commit28920330f86d628a287f00f2596f4aaead8e2e19 (patch)
treef27da691e65fcd14f04439df2628aa28cd3682f4 /package/network/services/wireguard
parent7204736076b277977388ad43cd69f221a377ed7e (diff)
downloadupstream-28920330f86d628a287f00f2596f4aaead8e2e19.tar.gz
upstream-28920330f86d628a287f00f2596f4aaead8e2e19.tar.bz2
upstream-28920330f86d628a287f00f2596f4aaead8e2e19.zip
wireguard: introduce 'nohostroute' option
Instead of creating host-routes depending on fwmark as (accidentally) pushed by commit 1e8bb50b93 ("wireguard: do not add host-dependencies if fwmark is set") use a new config option 'nohostroute' to explicitely prevent creation of the route to the endpoint. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/network/services/wireguard')
-rw-r--r--package/network/services/wireguard/files/wireguard.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/package/network/services/wireguard/files/wireguard.sh b/package/network/services/wireguard/files/wireguard.sh
index 58e47f9450..fb781070d6 100644
--- a/package/network/services/wireguard/files/wireguard.sh
+++ b/package/network/services/wireguard/files/wireguard.sh
@@ -114,6 +114,7 @@ proto_wireguard_setup() {
config_get mtu "${config}" "mtu"
config_get fwmark "${config}" "fwmark"
config_get ip6prefix "${config}" "ip6prefix"
+ config_get nohostroute "${config}" "nohostroute"
# create interface
ip link del dev "${config}" 2>/dev/null
@@ -176,7 +177,7 @@ proto_wireguard_setup() {
done
# endpoint dependency
- if [ ! "${fwmark}" ]; then
+ if [ "${nohostroute}" != "1" ]; then
wg show "${config}" endpoints | \
sed -E 's/\[?([0-9.:a-f]+)\]?:([0-9]+)/\1 \2/' | \
while IFS=$'\t ' read -r key address port; do