mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-19 13:48:06 +00:00
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>
This commit is contained in:
parent
b2152c8e6b
commit
1e8bb50b93
@ -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}"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user