* 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 ad32e27c6e31ec849466f52389c5ca4845cf9f6b..855bc4a816258ca57e7c21d71436b6ed4bdfec93 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