Diff

mod_secure_interfaces/mod_secure_interfaces.lua @ 2726:55f3ab952d06

mod_secure_interfaces: Add debug log in non-secure case also
author Matthew Wild <mwild1@gmail.com>
date Thu, 06 Jul 2017 10:48:39 +0100
parent 1177:a464261deba8
child 2730:cd828b1cb5b9
line wrap: on
line diff
--- a/mod_secure_interfaces/mod_secure_interfaces.lua	Thu Apr 27 12:41:53 2017 +0200
+++ b/mod_secure_interfaces/mod_secure_interfaces.lua	Thu Jul 06 10:48:39 2017 +0100
@@ -4,10 +4,15 @@
 	local session = event.origin;
 	if session.type ~= "c2s_unauthed" then return; end
 	local socket = session.conn:socket();
-	if not socket.getsockname then return; end
+	if not socket.getsockname then
+		module:log("debug", "Unable to determine local address of incoming connection");
+		return;
+	end
 	local localip = socket:getsockname();
 	if secure_interfaces:contains(localip) then
-		module:log("debug", "Marking session from %s as secure", session.ip or "[?]");
+		module:log("debug", "Marking session from %s to %s as secure", session.ip or "[?]", localip);
 		session.secure = true;
+	else
+		module:log("debug", "Not marking session from %s to %s as secure", session.ip or "[?]", localip);
 	end
 end, 2500);