summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-04-23 17:29:52 +0200
committerGitHub <noreply@github.com>2019-04-23 17:29:52 +0200
commit3c7b3fa171fa84b153479af36e99b6ebe35920c2 (patch)
tree4cb4194c0b2e6828b5943cb6af368da247cdeb6f /modules/luci-base
parentf223a76fdc675889017f9ff70a6b2c2e404882f6 (diff)
parent8fffadecc5d8080a7381fd6d00e5b4e91a6fc6fd (diff)
Merge pull request #2681 from dibdot/shadowsocks-fix
luci-app-shadowsocks-libev: fix cidr datatype
Diffstat (limited to 'modules/luci-base')
-rw-r--r--modules/luci-base/luasrc/cbi/datatypes.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/luci-base/luasrc/cbi/datatypes.lua b/modules/luci-base/luasrc/cbi/datatypes.lua
index b4206e98d..33d018d2d 100644
--- a/modules/luci-base/luasrc/cbi/datatypes.lua
+++ b/modules/luci-base/luasrc/cbi/datatypes.lua
@@ -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("^([^/]+)/([^/]+)$")