From: Jo-Philipp Wich Date: Fri, 8 Aug 2008 01:32:55 +0000 (+0000) Subject: * luci/libs: add assert() to contains() in luci.ip X-Git-Tag: 0.8.0~499 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9587d9db023db097fbf53e391cf8afbbe9d240fd;p=project%2Fluci.git * luci/libs: add assert() to contains() in luci.ip --- diff --git a/libs/core/luasrc/ip.lua b/libs/core/luasrc/ip.lua index ad32e27c6e..855bc4a816 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