Merge pull request #2681 from dibdot/shadowsocks-fix

luci-app-shadowsocks-libev: fix cidr datatype
This commit is contained in:
Jo-Philipp Wich 2019-04-23 17:29:52 +02:00 committed by GitHub
commit 3c7b3fa171
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,6 +132,10 @@ function ip6prefix(val)
return ( val and val >= 0 and val <= 128 )
end
function cidr(val)
return cidr4(val) or cidr6(val)
end
function cidr4(val)
local ip, mask = val:match("^([^/]+)/([^/]+)$")