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.lede-project.org./?a=commitdiff_plain;h=46fd88ec6c4ce7da611c45cbe2b3a0791d6c4e06;p=project%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 98f6a44d77..72b41ddad8 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