From 8fffadecc5d8080a7381fd6d00e5b4e91a6fc6fd Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Tue, 23 Apr 2019 15:42:53 +0200 Subject: luci-app-shadowsocks-libev: fix cidr datatype * add a new 'cidr' alias datatype to fix #2671 Signed-off-by: Dirk Brenken --- modules/luci-base/luasrc/cbi/datatypes.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/luci-base/luasrc/cbi') 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("^([^/]+)/([^/]+)$") -- cgit v1.2.3