projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8d839dd
)
luci-app-shadowsocks-libev: fix cidr datatype
2681/head
author
Dirk Brenken
<dev@brenken.org>
Tue, 23 Apr 2019 13:42:53 +0000
(15:42 +0200)
committer
Dirk Brenken
<dev@brenken.org>
Tue, 23 Apr 2019 14:57:05 +0000
(16:57 +0200)
* add a new 'cidr' alias datatype to fix #2671
Signed-off-by: Dirk Brenken <dev@brenken.org>
modules/luci-base/luasrc/cbi/datatypes.lua
patch
|
blob
|
history
diff --git
a/modules/luci-base/luasrc/cbi/datatypes.lua
b/modules/luci-base/luasrc/cbi/datatypes.lua
index b4206e98df3e118e4c646f239dfe80c0d08ba2ee..33d018d2d03340bc892ec9c54344fd0815585604 100644
(file)
--- 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("^([^/]+)/([^/]+)$")