diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-17 12:32:46 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-29 01:23:24 +0200 |
commit | 02a90ada7b6a022971027671fb2b95a2678c612d (patch) | |
tree | 434fb7ed135e735d89787de829726e9ea63f91a0 /src/tools | |
parent | qemu: use newer iproute2 and kernel (diff) | |
download | wireguard-monolithic-historical-02a90ada7b6a022971027671fb2b95a2678c612d.tar.xz wireguard-monolithic-historical-02a90ada7b6a022971027671fb2b95a2678c612d.zip |
wg-quick: look up existing routes properly
This was never really correct, and then 5.1 broke it entirely.
Reported-by: piraty1@inbox.ru
Diffstat (limited to 'src/tools')
-rwxr-xr-x | src/tools/wg-quick/linux.bash | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash index 5eaa504..8f1812c 100755 --- a/src/tools/wg-quick/linux.bash +++ b/src/tools/wg-quick/linux.bash @@ -164,7 +164,7 @@ add_route() { elif [[ $1 == */0 ]]; then add_default "$1" else - [[ $(ip route get "$1" 2>/dev/null) == *dev\ $INTERFACE\ * ]] || cmd ip route add "$1" dev "$INTERFACE" + [[ -n $(ip route show dev "$INTERFACE" match "$1" 2>/dev/null) ]] || cmd ip route add "$1" dev "$INTERFACE" fi } |