From d85f7a8a00bfa80ab1e8613446eb4d722dcd6ea5 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 30 Jan 2017 19:14:08 +0100 Subject: luci-base: fix logic errors in ipmask4 and ipmask6 datatype validators Signed-off-by: Jo-Philipp Wich --- modules/luci-base/luasrc/cbi/datatypes.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- cgit v1.2.3