From: Laura Hausmann Date: Thu, 12 Aug 2021 19:29:15 +0000 (+0200) Subject: wg-quick: darwin: account for "link#XX" gateways X-Git-Tag: v1.0.20210914~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3aafa6103be853678b4c74664e2fcdfba597b55;p=thirdparty%2Fwireguard-tools.git 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 Signed-off-by: Jason A. Donenfeld --- 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)