From: Jason A. Donenfeld Date: Fri, 7 Jul 2017 14:17:07 +0000 (+0200) Subject: wireguard: assume /32 or /128 if no CIDR is given X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=4d0d9ac3f9640aa082a207cb779e0018ec3013fb;p=openwrt-packages.git wireguard: assume /32 or /128 if no CIDR is given This brings the route_allowed_ips option into parity with the addresses option, which makes these same assumption. The parsing selection is made to be identical between these two settings. Signed-off-by: Jason A. Donenfeld --- diff --git a/net/wireguard/files/wireguard.sh b/net/wireguard/files/wireguard.sh index a826688d7..7b18a2e0e 100644 --- a/net/wireguard/files/wireguard.sh +++ b/net/wireguard/files/wireguard.sh @@ -82,9 +82,15 @@ proto_wireguard_setup_peer() { *:*/*) proto_add_ipv6_route "${allowed_ip%%/*}" "${allowed_ip##*/}" ;; - */*) + *.*/*) proto_add_ipv4_route "${allowed_ip%%/*}" "${allowed_ip##*/}" ;; + *:*) + proto_add_ipv6_route "${allowed_ip%%/*}" "128" + ;; + *.*) + proto_add_ipv4_route "${allowed_ip%%/*}" "32" + ;; esac done fi