aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/wireguard
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2019-03-19 16:47:17 +0100
committerDaniel Golle <daniel@makrotopia.org>2019-03-27 22:53:14 +0100
commit1e8bb50b9324cb368fe5b2bd916c98b8d8517be5 (patch)
tree62f4b55f68a0c7da1826578c18533f466c1b9cd0 /package/network/services/wireguard
parentb2152c8e6beaddded3aab0a3383f24624d6895f1 (diff)
downloadupstream-1e8bb50b9324cb368fe5b2bd916c98b8d8517be5.tar.gz
upstream-1e8bb50b9324cb368fe5b2bd916c98b8d8517be5.tar.bz2
upstream-1e8bb50b9324cb368fe5b2bd916c98b8d8517be5.zip
wireguard: do not add host-dependencies if fwmark is set
The 'fwmark' option is used to define routing traffic to wireguard endpoints to go through specific routing tables. In that case it doesn't make sense to setup routes for host-dependencies in the 'main' table, so skip setting host dependencies if 'fwmark' is set. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/network/services/wireguard')
-rw-r--r--package/network/services/wireguard/files/wireguard.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/package/network/services/wireguard/files/wireguard.sh b/package/network/services/wireguard/files/wireguard.sh
index 96fa7215ff..58e47f9450 100644
--- a/package/network/services/wireguard/files/wireguard.sh
+++ b/package/network/services/wireguard/files/wireguard.sh
@@ -176,12 +176,14 @@ proto_wireguard_setup() {
done
# endpoint dependency
- wg show "${config}" endpoints | \
- 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}"
- done
+ if [ ! "${fwmark}" ]; 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
+ [ -n "${port}" ] || continue
+ proto_add_host_dependency "${config}" "${address}"
+ done
+ fi
proto_send_update "${config}"
}