wg-quick: check correct variable for route deduplication

Reported-by: John Sager <john@sager.me.uk>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-08-21 15:42:17 -07:00
parent ffcc09358e
commit b2ec7892c8

View file

@ -168,7 +168,7 @@ add_route() {
elif [[ $1 == */0 ]]; then elif [[ $1 == */0 ]]; then
add_default "$1" add_default "$1"
else else
[[ $(ip route get "$i" 2>/dev/null) == *dev\ $INTERFACE\ * ]] || cmd ip route add "$1" dev "$INTERFACE" [[ $(ip route get "$1" 2>/dev/null) == *dev\ $INTERFACE\ * ]] || cmd ip route add "$1" dev "$INTERFACE"
fi fi
} }