Changeset

6928:02717098cbba

Merge 0.10->trunk
author Matthew Wild <mwild1@gmail.com>
date Sun, 22 Nov 2015 15:52:10 +0000
parents 6925:3c4799467dae (current diff) 6927:566e1cfcb814 (diff)
children 6929:03bc9e197fcc 6934:5d913559d092
files plugins/mod_admin_telnet.lua
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Tue Nov 17 17:12:45 2015 +0000
+++ b/plugins/mod_admin_telnet.lua	Sun Nov 22 15:52:10 2015 +0000
@@ -512,6 +512,9 @@
 	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
 
--- a/util/ip.lua	Tue Nov 17 17:12:45 2015 +0000
+++ b/util/ip.lua	Sun Nov 22 15:52:10 2015 +0000
@@ -229,13 +229,10 @@
 
 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,