aboutsummaryrefslogtreecommitdiffstats
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
commit217d0135d1da5f00a8b21dcca8b61ff16dd126d0 (patch)
tree3e427379d7463fcf546ddc9318100d488a5d5908
parente4f2d5b6cd12d6f850ab39acb7a311efd9a2aaec (diff)
parentc3b43754d587da5a1f8c474990ebcb3642deadab (diff)
downloadprosody-217d0135d1da5f00a8b21dcca8b61ff16dd126d0.tar.gz
prosody-217d0135d1da5f00a8b21dcca8b61ff16dd126d0.zip
Merge 0.10->trunk
-rw-r--r--plugins/mod_admin_telnet.lua3
-rw-r--r--util/ip.lua5
2 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index 16b16e88..e2aaa7bc 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -512,6 +512,9 @@ local function session_flags(session, line)
if session.ip and session.ip:match(":") then
line[#line+1] = "(IPv6)";
end
+ if session.remote then
+ line[#line+1] = "(remote)";
+ end
return table.concat(line, " ");
end
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,