diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/core/luasrc/ip.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/core/luasrc/ip.lua b/libs/core/luasrc/ip.lua index a33c34964..ea243f950 100644 --- a/libs/core/luasrc/ip.lua +++ b/libs/core/luasrc/ip.lua @@ -321,8 +321,10 @@ function cidr.mask( self, bits ) end function cidr.contains( self, addr ) - if self:mask() <= addr:mask() then - return self:mask(addr:prefix()) == addr:mask() + local mask1 = self:mask() + local mask2 = addr:mask() + if mask1 <= mask2 then + return self:mask(addr:prefix()) == mask2 end return false |