Skip to content

Commit b3aafa6

Browse files
zotanmewzx2c4
authored andcommitted
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 <[email protected]> Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 52597c3 commit b3aafa6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wg-quick/darwin.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,14 @@ collect_gateways() {
194194

195195
GATEWAY4=""
196196
while read -r destination gateway _; do
197-
[[ $destination == default ]] || continue
197+
[[ $destination == default && $gateway != "link#"* ]] || continue
198198
GATEWAY4="$gateway"
199199
break
200200
done < <(netstat -nr -f inet)
201201

202202
GATEWAY6=""
203203
while read -r destination gateway _; do
204-
[[ $destination == default ]] || continue
204+
[[ $destination == default && $gateway != "link#"* ]] || continue
205205
GATEWAY6="$gateway"
206206
break
207207
done < <(netstat -nr -f inet6)

0 commit comments

Comments
 (0)