From 9587d9db023db097fbf53e391cf8afbbe9d240fd Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 8 Aug 2008 01:32:55 +0000 Subject: [PATCH] * luci/libs: add assert() to contains() in luci.ip --- libs/core/luasrc/ip.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/core/luasrc/ip.lua b/libs/core/luasrc/ip.lua index ad32e27c6..855bc4a81 100644 --- a/libs/core/luasrc/ip.lua +++ b/libs/core/luasrc/ip.lua @@ -360,6 +360,7 @@ function cidr.mask( self, bits ) end function cidr.contains( self, addr ) + assert( self[1] == addr[1], "Can't compare IPv4 and IPv6 addresses" ) local mask1 = self:mask() local mask2 = addr:mask() if mask1 <= mask2 then -- 2.25.1