]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
wg-quick: darwin: do not remove routes when no real interface
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 22 May 2018 14:32:40 +0000 (16:32 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 22 May 2018 14:41:59 +0000 (16:41 +0200)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/wg-quick/darwin.bash

index 8387d854535e4284f3f944dcd79a771057cf3229..566cfead41d2c075c1de993f694f2005b1b34bf4 100755 (executable)
@@ -107,6 +107,7 @@ add_if() {
 }
 
 del_routes() {
+       [[ -n $REAL_INTERFACE ]] || return 0
        local todelete=( ) destination gateway netif
        while read -r destination _ _ _ _ netif _; do
                [[ $netif == "$REAL_INTERFACE" ]] && todelete+=( "$destination" )