From 5536e6de4667aad0cc1b9720b5cef6605455ca99 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 13 Dec 2017 01:17:55 +0100 Subject: [PATCH] wg-quick: dumber matching for default routes Signed-off-by: Jason A. Donenfeld --- src/wg-quick.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wg-quick.bash b/src/wg-quick.bash index c2d43fc..89effdf 100755 --- a/src/wg-quick.bash +++ b/src/wg-quick.bash @@ -152,7 +152,7 @@ add_route() { if [[ -n $TABLE && $TABLE != auto ]]; then cmd ip route add "$1" dev "$INTERFACE" table "$TABLE" - elif [[ $1 == 0.0.0.0/0 || $1 =~ ^[0:]+/0$ ]]; then + elif [[ $1 == */0 ]]; then add_default "$1" else [[ $(ip route get "$i" 2>/dev/null) == *dev\ $INTERFACE\ * ]] || cmd ip route add "$1" dev "$INTERFACE"