aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2010-05-15 19:25:14 -0700
committerDiva Canto2010-05-15 19:25:14 -0700
commit2a1e45f65736214a9e8d782be1f92bb78725121f (patch)
tree27a2f60b2c68ac1c8ac5d7886c9bfa743c8cb24d
parentdelete now unused MessageServerInfo (diff)
downloadopensim-SC-2a1e45f65736214a9e8d782be1f92bb78725121f.zip
opensim-SC-2a1e45f65736214a9e8d782be1f92bb78725121f.tar.gz
opensim-SC-2a1e45f65736214a9e8d782be1f92bb78725121f.tar.bz2
opensim-SC-2a1e45f65736214a9e8d782be1f92bb78725121f.tar.xz
Finalized the client's TCP IP address verification process for HG1.5.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/AgentCircuitManager.cs26
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs12
-rw-r--r--OpenSim/Framework/IScene.cs2
-rw-r--r--OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs95
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs5
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs5
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs27
-rw-r--r--OpenSim/Services/Interfaces/IGatekeeperService.cs1
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs17
11 files changed, 148 insertions, 45 deletions
diff --git a/OpenSim/Framework/AgentCircuitManager.cs b/OpenSim/Framework/AgentCircuitManager.cs
index e5dbb5a..49d7822 100644
--- a/OpenSim/Framework/AgentCircuitManager.cs
+++ b/OpenSim/Framework/AgentCircuitManager.cs
@@ -36,6 +36,7 @@ namespace OpenSim.Framework
36 public class AgentCircuitManager 36 public class AgentCircuitManager
37 { 37 {
38 public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); 38 public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
39 public Dictionary<UUID, AgentCircuitData> AgentCircuitsByUUID = new Dictionary<UUID, AgentCircuitData>();
39 40
40 public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode) 41 public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode)
41 { 42 {
@@ -86,10 +87,12 @@ namespace OpenSim.Framework
86 if (AgentCircuits.ContainsKey(circuitCode)) 87 if (AgentCircuits.ContainsKey(circuitCode))
87 { 88 {
88 AgentCircuits[circuitCode] = agentData; 89 AgentCircuits[circuitCode] = agentData;
90 AgentCircuitsByUUID[agentData.AgentID] = agentData;
89 } 91 }
90 else 92 else
91 { 93 {
92 AgentCircuits.Add(circuitCode, agentData); 94 AgentCircuits.Add(circuitCode, agentData);
95 AgentCircuitsByUUID.Add(agentData.AgentID, agentData);
93 } 96 }
94 } 97 }
95 } 98 }
@@ -99,10 +102,26 @@ namespace OpenSim.Framework
99 lock (AgentCircuits) 102 lock (AgentCircuits)
100 { 103 {
101 if (AgentCircuits.ContainsKey(circuitCode)) 104 if (AgentCircuits.ContainsKey(circuitCode))
105 {
106 UUID agentID = AgentCircuits[circuitCode].AgentID;
102 AgentCircuits.Remove(circuitCode); 107 AgentCircuits.Remove(circuitCode);
108 AgentCircuitsByUUID.Remove(agentID);
109 }
103 } 110 }
104 } 111 }
105 112
113 public virtual void RemoveCircuit(UUID agentID)
114 {
115 lock (AgentCircuits)
116 {
117 if (AgentCircuitsByUUID.ContainsKey(agentID))
118 {
119 uint circuitCode = AgentCircuitsByUUID[agentID].circuitcode;
120 AgentCircuits.Remove(circuitCode);
121 AgentCircuitsByUUID.Remove(agentID);
122 }
123 }
124 }
106 public AgentCircuitData GetAgentCircuitData(uint circuitCode) 125 public AgentCircuitData GetAgentCircuitData(uint circuitCode)
107 { 126 {
108 AgentCircuitData agentCircuit = null; 127 AgentCircuitData agentCircuit = null;
@@ -110,6 +129,13 @@ namespace OpenSim.Framework
110 return agentCircuit; 129 return agentCircuit;
111 } 130 }
112 131
132 public AgentCircuitData GetAgentCircuitData(UUID agentID)
133 {
134 AgentCircuitData agentCircuit = null;
135 AgentCircuitsByUUID.TryGetValue(agentID, out agentCircuit);
136 return agentCircuit;
137 }
138
113 public void UpdateAgentData(AgentCircuitData agentData) 139 public void UpdateAgentData(AgentCircuitData agentData)
114 { 140 {
115 if (AgentCircuits.ContainsKey((uint) agentData.circuitcode)) 141 if (AgentCircuits.ContainsKey((uint) agentData.circuitcode))
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index b27d011..62a1e17 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -99,6 +99,7 @@ namespace OpenSim.Framework.Capabilities
99 // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. 99 // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
100 100
101 //private string eventQueue = "0100/"; 101 //private string eventQueue = "0100/";
102 private IScene m_Scene;
102 private IHttpServer m_httpListener; 103 private IHttpServer m_httpListener;
103 private UUID m_agentID; 104 private UUID m_agentID;
104 private IAssetService m_assetCache; 105 private IAssetService m_assetCache;
@@ -130,9 +131,10 @@ namespace OpenSim.Framework.Capabilities
130 public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null; 131 public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null;
131 public GetClientDelegate GetClient = null; 132 public GetClientDelegate GetClient = null;
132 133
133 public Caps(IAssetService assetCache, IHttpServer httpServer, string httpListen, uint httpPort, string capsPath, 134 public Caps(IScene scene, IAssetService assetCache, IHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
134 UUID agent, bool dumpAssetsToFile, string regionName) 135 UUID agent, bool dumpAssetsToFile, string regionName)
135 { 136 {
137 m_Scene = scene;
136 m_assetCache = assetCache; 138 m_assetCache = assetCache;
137 m_capsObjectPath = capsPath; 139 m_capsObjectPath = capsPath;
138 m_httpListener = httpServer; 140 m_httpListener = httpServer;
@@ -278,7 +280,13 @@ namespace OpenSim.Framework.Capabilities
278 public string CapsRequest(string request, string path, string param, 280 public string CapsRequest(string request, string path, string param,
279 OSHttpRequest httpRequest, OSHttpResponse httpResponse) 281 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
280 { 282 {
281 //m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName); 283 m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
284
285 if (!m_Scene.CheckClient(m_agentID, httpRequest.RemoteIPEndPoint))
286 {
287 m_log.DebugFormat("[CAPS]: Unauthorized CAPS client");
288 return string.Empty;
289 }
282 290
283 string result = LLSDHelpers.SerialiseLLSDReply(m_capsHandlers.CapsDetails); 291 string result = LLSDHelpers.SerialiseLLSDReply(m_capsHandlers.CapsDetails);
284 292
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs
index 19ab409..6798b7b 100644
--- a/OpenSim/Framework/IScene.cs
+++ b/OpenSim/Framework/IScene.cs
@@ -102,5 +102,7 @@ namespace OpenSim.Framework
102 void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback); 102 void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback);
103 103
104 ISceneObject DeserializeObject(string representation); 104 ISceneObject DeserializeObject(string representation);
105
106 bool CheckClient(UUID agentID, System.Net.IPEndPoint ep);
105 } 107 }
106} 108}
diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
index 2a1355b..a6f5d97 100644
--- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
107 } 107 }
108 108
109 Caps caps 109 Caps caps
110 = new Caps( 110 = new Caps(m_scene,
111 m_scene.AssetService, MainServer.Instance, m_scene.RegionInfo.ExternalHostName, 111 m_scene.AssetService, MainServer.Instance, m_scene.RegionInfo.ExternalHostName,
112 MainServer.Instance.Port, 112 MainServer.Instance.Port,
113 capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName); 113 capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index edbef4c..401551d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2629,34 +2629,23 @@ namespace OpenSim.Region.Framework.Scenes
2629 AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); 2629 AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
2630 2630
2631 // Do the verification here 2631 // Do the verification here
2632 System.Net.EndPoint ep = client.GetClientEP(); 2632 System.Net.IPEndPoint ep = (System.Net.IPEndPoint)client.GetClientEP();
2633 if (aCircuit != null) 2633 if (aCircuit != null)
2634 { 2634 {
2635 if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) 2635 if (!VerifyClient(aCircuit, ep, out vialogin))
2636 { 2636 {
2637 m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); 2637 // uh-oh, this is fishy
2638 vialogin = true; 2638 m_log.WarnFormat("[Scene]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.",
2639 IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>(); 2639 client.AgentId, client.SessionId, ep.ToString());
2640 if (userVerification != null && ep != null) 2640 try
2641 { 2641 {
2642 if (!userVerification.VerifyClient(aCircuit, ep.ToString())) 2642 client.Close();
2643 { 2643 }
2644 // uh-oh, this is fishy 2644 catch (Exception e)
2645 m_log.WarnFormat("[Scene]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", 2645 {
2646 client.AgentId, client.SessionId, ep.ToString()); 2646 m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace);
2647 try
2648 {
2649 client.Close();
2650 }
2651 catch (Exception e)
2652 {
2653 m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace);
2654 }
2655 return;
2656 }
2657 else
2658 m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} returned true", aCircuit.firstname, aCircuit.lastname);
2659 } 2647 }
2648 return;
2660 } 2649 }
2661 } 2650 }
2662 2651
@@ -2682,7 +2671,65 @@ namespace OpenSim.Region.Framework.Scenes
2682 EventManager.TriggerOnClientLogin(client); 2671 EventManager.TriggerOnClientLogin(client);
2683 } 2672 }
2684 2673
2685 2674 private bool VerifyClient(AgentCircuitData aCircuit, System.Net.IPEndPoint ep, out bool vialogin)
2675 {
2676 vialogin = false;
2677
2678 // Do the verification here
2679 if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0)
2680 {
2681 m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2682 vialogin = true;
2683 IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
2684 if (userVerification != null && ep != null)
2685 {
2686 if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString()))
2687 {
2688 // uh-oh, this is fishy
2689 m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2690 return false;
2691 }
2692 else
2693 m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2694 }
2695 }
2696
2697 return true;
2698 }
2699
2700 // Called by Caps, on the first HTTP contact from the client
2701 public override bool CheckClient(UUID agentID, System.Net.IPEndPoint ep)
2702 {
2703 AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(agentID);
2704 if (aCircuit != null)
2705 {
2706 bool vialogin = false;
2707 if (!VerifyClient(aCircuit, ep, out vialogin))
2708 {
2709 // if it doesn't pass, we remove the agentcircuitdata altogether
2710 // and the scene presence and the client, if they exist
2711 try
2712 {
2713 ScenePresence sp = GetScenePresence(agentID);
2714 if (sp != null)
2715 sp.ControllingClient.Close();
2716
2717 // BANG! SLASH!
2718 m_authenticateHandler.RemoveCircuit(agentID);
2719
2720 return false;
2721 }
2722 catch (Exception e)
2723 {
2724 m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace);
2725 }
2726 }
2727 else
2728 return true;
2729 }
2730
2731 return false;
2732 }
2686 2733
2687 /// <summary> 2734 /// <summary>
2688 /// Register for events from the client 2735 /// Register for events from the client
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index 3218dad..bfc19b7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -536,5 +536,6 @@ namespace OpenSim.Region.Framework.Scenes
536 get { return false; } 536 get { return false; }
537 } 537 }
538 538
539 public abstract bool CheckClient(UUID agentID, System.Net.IPEndPoint ep);
539 } 540 }
540} 541}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
index dd9f8f6..42587c1 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
@@ -70,6 +70,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
70 { 70 {
71 throw new NotImplementedException(); 71 throw new NotImplementedException();
72 } 72 }
73
74 public override bool CheckClient(UUID agentID, System.Net.IPEndPoint ep)
75 {
76 throw new NotImplementedException();
77 }
73 } 78 }
74 79
75 [Test] 80 [Test]
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 3e91e3a..42eca05 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -204,6 +204,11 @@ namespace OpenSim.Services.Connectors.Hypergrid
204 return args; 204 return args;
205 } 205 }
206 206
207 public void SetClientToken(UUID sessionID, string token)
208 {
209 // no-op
210 }
211
207 public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt) 212 public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt)
208 { 213 {
209 position = Vector3.UnitY; lookAt = Vector3.UnitY; 214 position = Vector3.UnitY; lookAt = Vector3.UnitY;
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index 64f7e8a..0172960 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -148,6 +148,15 @@ namespace OpenSim.Services.HypergridService
148 return true; 148 return true;
149 } 149 }
150 150
151 public void SetClientToken(UUID sessionID, string token)
152 {
153 if (m_TravelingAgents.ContainsKey(sessionID))
154 {
155 m_log.DebugFormat("[USER AGENT SERVICE]: Setting token {0} for session {1}", token, sessionID);
156 m_TravelingAgents[sessionID].ClientToken = token;
157 }
158 }
159
151 TravelingAgentInfo UpdateTravelInfo(AgentCircuitData agentCircuit, GridRegion region) 160 TravelingAgentInfo UpdateTravelInfo(AgentCircuitData agentCircuit, GridRegion region)
152 { 161 {
153 TravelingAgentInfo travel = new TravelingAgentInfo(); 162 TravelingAgentInfo travel = new TravelingAgentInfo();
@@ -203,22 +212,16 @@ namespace OpenSim.Services.HypergridService
203 212
204 public bool VerifyClient(UUID sessionID, string token) 213 public bool VerifyClient(UUID sessionID, string token)
205 { 214 {
206 return true; 215 m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token);
216 //return true;
207 217
208 // Commenting this for now until I understand better what part of a sender's 218 // Commenting this for now until I understand better what part of a sender's
209 // info stays unchanged throughout a session 219 // info stays unchanged throughout a session
210 // 220 //
211 //if (m_TravelingAgents.ContainsKey(sessionID)) 221 if (m_TravelingAgents.ContainsKey(sessionID))
212 //{ 222 return m_TravelingAgents[sessionID].ClientToken == token;
213 // // Aquiles heel. Must trust the first grid upon login 223
214 // if (m_TravelingAgents[sessionID].ClientToken == string.Empty) 224 return false;
215 // {
216 // m_TravelingAgents[sessionID].ClientToken = token;
217 // return true;
218 // }
219 // return m_TravelingAgents[sessionID].ClientToken == token;
220 //}
221 //return false;
222 } 225 }
223 226
224 public bool VerifyAgent(UUID sessionID, string token) 227 public bool VerifyAgent(UUID sessionID, string token)
diff --git a/OpenSim/Services/Interfaces/IGatekeeperService.cs b/OpenSim/Services/Interfaces/IGatekeeperService.cs
index ca7b9b3..2d397bc 100644
--- a/OpenSim/Services/Interfaces/IGatekeeperService.cs
+++ b/OpenSim/Services/Interfaces/IGatekeeperService.cs
@@ -49,6 +49,7 @@ namespace OpenSim.Services.Interfaces
49 public interface IUserAgentService 49 public interface IUserAgentService
50 { 50 {
51 bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, out string reason); 51 bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, out string reason);
52 void SetClientToken(UUID sessionID, string token);
52 void LogoutAgent(UUID userID, UUID sessionID); 53 void LogoutAgent(UUID userID, UUID sessionID);
53 GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); 54 GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt);
54 55
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 9e24a39..7471c77 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -329,7 +329,7 @@ namespace OpenSim.Services.LLLoginService
329 // Instantiate/get the simulation interface and launch an agent at the destination 329 // Instantiate/get the simulation interface and launch an agent at the destination
330 // 330 //
331 string reason = string.Empty; 331 string reason = string.Empty;
332 AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, out where, out reason); 332 AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, clientIP, out where, out reason);
333 333
334 if (aCircuit == null) 334 if (aCircuit == null)
335 { 335 {
@@ -589,7 +589,7 @@ namespace OpenSim.Services.LLLoginService
589 } 589 }
590 590
591 protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, 591 protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar,
592 UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, out string where, out string reason) 592 UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, IPEndPoint clientIP, out string where, out string reason)
593 { 593 {
594 where = currentWhere; 594 where = currentWhere;
595 ISimulationService simConnector = null; 595 ISimulationService simConnector = null;
@@ -655,7 +655,7 @@ namespace OpenSim.Services.LLLoginService
655 { 655 {
656 circuitCode = (uint)Util.RandomClass.Next(); ; 656 circuitCode = (uint)Util.RandomClass.Next(); ;
657 aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); 657 aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer);
658 success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, out reason); 658 success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason);
659 if (!success && m_GridService != null) 659 if (!success && m_GridService != null)
660 { 660 {
661 // Try the fallback regions 661 // Try the fallback regions
@@ -664,7 +664,7 @@ namespace OpenSim.Services.LLLoginService
664 { 664 {
665 foreach (GridRegion r in fallbacks) 665 foreach (GridRegion r in fallbacks)
666 { 666 {
667 success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, out reason); 667 success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, clientIP, out reason);
668 if (success) 668 if (success)
669 { 669 {
670 where = "safe"; 670 where = "safe";
@@ -741,10 +741,15 @@ namespace OpenSim.Services.LLLoginService
741 return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason); 741 return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason);
742 } 742 }
743 743
744 private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, out string reason) 744 private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason)
745 { 745 {
746 m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); 746 m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName);
747 return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason); 747 if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason))
748 {
749 m_UserAgentService.SetClientToken(aCircuit.SessionID, clientIP.Address.ToString());
750 return true;
751 }
752 return false;
748 } 753 }
749 754
750 #region Console Commands 755 #region Console Commands