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: https://git.librecmc.org/?a=commitdiff_plain;h=d85f7a8a00bfa80ab1e8613446eb4d722dcd6ea5;p=oweals%2Fluci.git 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