diff --git a/srcpkgs/wireguard/patches/wg-quick-iproute2.patch b/srcpkgs/wireguard/patches/wg-quick-iproute2.patch new file mode 100644 index 00000000000..d52804ee660 --- /dev/null +++ b/srcpkgs/wireguard/patches/wg-quick-iproute2.patch @@ -0,0 +1,28 @@ +From c09671aa1318f52e0c0b5d2310b72644e9b2ea96 Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Fri, 17 May 2019 12:32:46 +0200 +Subject: wg-quick: look up existing routes properly + +This was never really correct, and then 5.1 broke it entirely. + +Reported-by: piraty1@inbox.ru +--- + src/tools/wg-quick/linux.bash | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash +index 5eaa5042..8f1812c1 100755 +--- src/tools/wg-quick/linux.bash ++++ 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 + } + +-- +cgit v1.2.1-20-gc37e + diff --git a/srcpkgs/wireguard/template b/srcpkgs/wireguard/template index e90b64143e2..8e054f5c4ed 100644 --- a/srcpkgs/wireguard/template +++ b/srcpkgs/wireguard/template @@ -1,7 +1,7 @@ # Template file for 'wireguard' pkgname=wireguard version=0.0.20190406 -revision=1 +revision=2 wrksrc="WireGuard-${version}" build_wrksrc="src/tools" build_style=gnu-makefile