From 24885819fccbecafb83cec81000416843d86a593 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 22 May 2017 22:04:20 +0100 Subject: [PATCH] check XFF headers of caller, but be quiet about them --- OpenSim/Server/Handlers/Map/MapAddServerConnector.cs | 6 +++--- OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs | 6 +++--- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs index bfd73a257b..331dabf9a9 100644 --- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs @@ -225,8 +225,8 @@ namespace OpenSim.Server.Handlers.MapImage private System.Net.IPAddress GetCallerIP(IOSHttpRequest request) { - if (!m_Proxy) - return request.RemoteIPEndPoint.Address; +// if (!m_Proxy) +// return request.RemoteIPEndPoint.Address; // We're behind a proxy string xff = "X-Forwarded-For"; @@ -236,7 +236,7 @@ namespace OpenSim.Server.Handlers.MapImage if (xffValue == null || (xffValue != null && xffValue == string.Empty)) { - m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header"); +// m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header"); return request.RemoteIPEndPoint.Address; } diff --git a/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs b/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs index 8a3875dc5d..9daeb73729 100644 --- a/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs @@ -229,8 +229,8 @@ namespace OpenSim.Server.Handlers.MapImage private System.Net.IPAddress GetCallerIP(IOSHttpRequest request) { - if (!m_Proxy) - return request.RemoteIPEndPoint.Address; +// if (!m_Proxy) +// return request.RemoteIPEndPoint.Address; // We're behind a proxy string xff = "X-Forwarded-For"; @@ -240,7 +240,7 @@ namespace OpenSim.Server.Handlers.MapImage if (xffValue == null || (xffValue != null && xffValue == string.Empty)) { - m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header"); +// m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header"); return request.RemoteIPEndPoint.Address; } diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index bb524e6eef..c52a1ab06b 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -531,11 +531,11 @@ namespace OpenSim.Server.Handlers.Simulation if (!headers.ContainsKey(xff) || headers[xff] == null) { - m_log.WarnFormat("[AGENT HANDLER]: No XFF header"); +// m_log.WarnFormat("[AGENT HANDLER]: No XFF header"); return Util.GetCallerIP(request); } - m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers[xff]); +// m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers[xff]); IPEndPoint ep = Util.GetClientIPFromXFF((string)headers[xff]); if (ep != null)