diff options
author | Laura Hausmann <laura@hausmann.dev> | 2021-08-12 21:29:15 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-08-12 22:03:04 +0200 |
commit | b3aafa6103be853678b4c74664e2fcdfba597b55 (patch) | |
tree | 4877ca6b4a4ca7d14e12f0ab5a6936ee62451b46 | |
parent | ipc: windows: use devpkey instead of nci for name (diff) | |
download | wireguard-tools-b3aafa6103be853678b4c74664e2fcdfba597b55.tar.xz wireguard-tools-b3aafa6103be853678b4c74664e2fcdfba597b55.zip |
wg-quick: darwin: account for "link#XX" gateways
On macOS, under specific configurations, the `netstat -nr -f inet` and
`netstat -nr -f inet6` outputs break gateway collection.
Signed-off-by: Laura Hausmann <laura@hausmann.dev>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rwxr-xr-x | src/wg-quick/darwin.bash | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wg-quick/darwin.bash b/src/wg-quick/darwin.bash index c77441f..8e46818 100755 --- a/src/wg-quick/darwin.bash +++ b/src/wg-quick/darwin.bash @@ -194,14 +194,14 @@ collect_gateways() { GATEWAY4="" while read -r destination gateway _; do - [[ $destination == default ]] || continue + [[ $destination == default && $gateway != "link#"* ]] || continue GATEWAY4="$gateway" break done < <(netstat -nr -f inet) GATEWAY6="" while read -r destination gateway _; do - [[ $destination == default ]] || continue + [[ $destination == default && $gateway != "link#"* ]] || continue GATEWAY6="$gateway" break done < <(netstat -nr -f inet6) |