* luci/libs: add assert() to contains() in luci.ip
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 8 Aug 2008 01:32:55 +0000 (01:32 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 8 Aug 2008 01:32:55 +0000 (01:32 +0000)
libs/core/luasrc/ip.lua

index ad32e27..855bc4a 100644 (file)
@@ -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