From: Jo-Philipp Wich Date: Mon, 30 Jan 2017 18:14:08 +0000 (+0100) Subject: luci-base: fix logic errors in ipmask4 and ipmask6 datatype validators X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=d85f7a8a00bfa80ab1e8613446eb4d722dcd6ea5;hp=926935f83170e38452a5191d13aa8b04021606ff luci-base: fix logic errors in ipmask4 and ipmask6 datatype validators Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/luasrc/cbi/datatypes.lua b/modules/luci-base/luasrc/cbi/datatypes.lua index 98f6a44d7..72b41ddad 100644 --- a/modules/luci-base/luasrc/cbi/datatypes.lua +++ b/modules/luci-base/luasrc/cbi/datatypes.lua @@ -143,7 +143,7 @@ function ipmask4(val) return false end - if not bits and not ip4addr(mask) then + if not bits and mask and not ip4addr(mask) then return false end @@ -158,7 +158,7 @@ function ipmask6(val) return false end - if not bits and not ip6addr(mask) then + if not bits and mask and not ip6addr(mask) then return false end