summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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 b4206e98df..33d018d2d0 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("^([^/]+)/([^/]+)$")