diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-01-15 13:01:06 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-01-15 13:01:06 +0100 |
commit | 727ff452ce057981f5e10127fa8a5f42d5a0e783 (patch) | |
tree | a90333442e2fbabae629f12be49434db63db0b99 | |
parent | ratelimiter: 800ms too fast, decrease to 2s sustained rate (diff) | |
download | wireguard-monolithic-historical-727ff452ce057981f5e10127fa8a5f42d5a0e783.tar.xz wireguard-monolithic-historical-727ff452ce057981f5e10127fa8a5f42d5a0e783.zip |
tools: wg-quick: parse IPv6 endpoints correctly
-rwxr-xr-x | src/tools/wg-quick.bash | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/wg-quick.bash b/src/tools/wg-quick.bash index d611a83..b6fcef8 100755 --- a/src/tools/wg-quick.bash +++ b/src/tools/wg-quick.bash @@ -102,7 +102,7 @@ add_route() { } add_default() { - [[ $(join <(wg show "$INTERFACE" allowed-ips) <(wg show "$INTERFACE" endpoints)) =~ .*\ ${1//./\\.}\ ([0-9.:a-f]+):[0-9]+$ ]] && local endpoint="${BASH_REMATCH[1]}" + [[ $(join <(wg show "$INTERFACE" allowed-ips) <(wg show "$INTERFACE" endpoints)) =~ .*\ ${1//./\\.}\ \[?([0-9.:a-f]+)\]?:[0-9]+$ ]] && local endpoint="${BASH_REMATCH[1]}" [[ -n $endpoint ]] || return 0 local table=51820 while [[ -n $(ip route show table $table) ]]; do ((table++)); done |