From: Dirk Brenken Date: Tue, 23 Apr 2019 13:42:53 +0000 (+0200) Subject: luci-app-shadowsocks-libev: fix cidr datatype X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=refs%2Fpull%2F2681%2Fhead;p=oweals%2Fluci.git luci-app-shadowsocks-libev: fix cidr datatype * add a new 'cidr' alias datatype to fix #2671 Signed-off-by: Dirk Brenken --- 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("^([^/]+)/([^/]+)$")