diff options
author | Kitto Flora | 2010-09-06 21:45:17 +0000 |
---|---|---|
committer | Kitto Flora | 2010-09-06 21:45:17 +0000 |
commit | cfaefad754642677dbddfcbe743c3fa5e058785d (patch) | |
tree | 48ac26cc5289d8c0459837cd7d6936152216403b /OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs | |
parent | Falling animation fix, comment out instrumentation. (diff) | |
parent | Fix yet another cause of "Ghost attachments" (diff) | |
download | opensim-SC-cfaefad754642677dbddfcbe743c3fa5e058785d.zip opensim-SC-cfaefad754642677dbddfcbe743c3fa5e058785d.tar.gz opensim-SC-cfaefad754642677dbddfcbe743c3fa5e058785d.tar.bz2 opensim-SC-cfaefad754642677dbddfcbe743c3fa5e058785d.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs index e50481a..d10d6fc 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs | |||
@@ -54,9 +54,12 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | private IUserAgentService m_UserAgentService; | 55 | private IUserAgentService m_UserAgentService; |
56 | 56 | ||
57 | public HomeAgentHandler(IUserAgentService userAgentService) | 57 | private string m_LoginServerIP; |
58 | |||
59 | public HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP) | ||
58 | { | 60 | { |
59 | m_UserAgentService = userAgentService; | 61 | m_UserAgentService = userAgentService; |
62 | m_LoginServerIP = loginServerIP; | ||
60 | } | 63 | } |
61 | 64 | ||
62 | public Hashtable Handler(Hashtable request) | 65 | public Hashtable Handler(Hashtable request) |
@@ -120,6 +123,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
120 | string regionname = string.Empty; | 123 | string regionname = string.Empty; |
121 | string gatekeeper_host = string.Empty; | 124 | string gatekeeper_host = string.Empty; |
122 | int gatekeeper_port = 0; | 125 | int gatekeeper_port = 0; |
126 | IPEndPoint client_ipaddress = null; | ||
123 | 127 | ||
124 | if (args.ContainsKey("gatekeeper_host") && args["gatekeeper_host"] != null) | 128 | if (args.ContainsKey("gatekeeper_host") && args["gatekeeper_host"] != null) |
125 | gatekeeper_host = args["gatekeeper_host"].AsString(); | 129 | gatekeeper_host = args["gatekeeper_host"].AsString(); |
@@ -144,6 +148,24 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
144 | if (args.ContainsKey("destination_name") && args["destination_name"] != null) | 148 | if (args.ContainsKey("destination_name") && args["destination_name"] != null) |
145 | regionname = args["destination_name"].ToString(); | 149 | regionname = args["destination_name"].ToString(); |
146 | 150 | ||
151 | if (args.ContainsKey("client_ip") && args["client_ip"] != null) | ||
152 | { | ||
153 | string ip_str = args["client_ip"].ToString(); | ||
154 | try | ||
155 | { | ||
156 | string callerIP = Util.GetCallerIP(request); | ||
157 | // Verify if this caller has authority to send the client IP | ||
158 | if (callerIP == m_LoginServerIP) | ||
159 | client_ipaddress = new IPEndPoint(IPAddress.Parse(ip_str), 0); | ||
160 | else | ||
161 | m_log.WarnFormat("[HOME AGENT HANDLER]: Unauthorized machine {0} tried to set client ip to {1}", callerIP, ip_str); | ||
162 | } | ||
163 | catch | ||
164 | { | ||
165 | m_log.DebugFormat("[HOME AGENT HANDLER]: Exception parsing client ip address from {0}", ip_str); | ||
166 | } | ||
167 | } | ||
168 | |||
147 | GridRegion destination = new GridRegion(); | 169 | GridRegion destination = new GridRegion(); |
148 | destination.RegionID = uuid; | 170 | destination.RegionID = uuid; |
149 | destination.RegionLocX = x; | 171 | destination.RegionLocX = x; |
@@ -166,7 +188,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
166 | OSDMap resp = new OSDMap(2); | 188 | OSDMap resp = new OSDMap(2); |
167 | string reason = String.Empty; | 189 | string reason = String.Empty; |
168 | 190 | ||
169 | bool result = m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason); | 191 | bool result = m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, client_ipaddress, out reason); |
170 | 192 | ||
171 | resp["reason"] = OSD.FromString(reason); | 193 | resp["reason"] = OSD.FromString(reason); |
172 | resp["success"] = OSD.FromBoolean(result); | 194 | resp["success"] = OSD.FromBoolean(result); |