aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-11-22 15:52:10 +0000
committerMatthew Wild <mwild1@gmail.com>2015-11-22 15:52:10 +0000
commitc9af381fcea7a38807fb51685157798add05ec61 (patch)
tree3e427379d7463fcf546ddc9318100d488a5d5908 /util
parentdc786b603f38d2ed33ec00133689fdd27aae3db5 (diff)
parentad798d75d804d76c0651d25739655f5651c30f95 (diff)
downloadprosody-c9af381fcea7a38807fb51685157798add05ec61.tar.gz
prosody-c9af381fcea7a38807fb51685157798add05ec61.zip
Merge 0.10->trunk
Diffstat (limited to 'util')
-rw-r--r--util/ip.lua5
1 files changed, 1 insertions, 4 deletions
diff --git a/util/ip.lua b/util/ip.lua
index d0ae07eb..7dcace5c 100644
--- a/util/ip.lua
+++ b/util/ip.lua
@@ -229,13 +229,10 @@ end
local function match(ipA, ipB, bits)
local common_bits = commonPrefixLength(ipA, ipB);
- if not bits then
- return ipA == ipB;
- end
if bits and ipB.proto == "IPv4" then
common_bits = common_bits - 96; -- v6 mapped addresses always share these bits
end
- return common_bits >= bits;
+ return common_bits >= (bits or 128);
end
return {new_ip = new_ip,