diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index a216b52867..c3479184d9 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -210,9 +210,10 @@ namespace OpenSim.Framework.Types this.DataStore = GetString(configData, "Datastore", "localworld.yap", "Filename for local storage"); - IPAddress internalAddress = GetIPAddress(configData, "InternalIPAddress", "0.0.0.0", "Internal IP Address for UDP client connections"); + string internalAddress = GetString(configData, "InternalIPAddress", "0.0.0.0", "Internal IP Address for UDP client connections").ToString(); int internalPort = GetIPPort(configData, "InternalIPPort", "9000", "Internal IP Port for UDP client connections"); - m_internalEndPoint = new IPEndPoint(internalAddress, internalPort); + IPAddress internalIPAddress = Dns.GetHostByName(internalAddress).AddressList[0]; + m_internalEndPoint = new IPEndPoint(internalIPAddress, internalPort); m_externalHostName = GetString(configData, "ExternalHostName", "127.0.0.1", "External Host Name"); diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 22bffa0476..b3ba4e5d24 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Net; using System.Reflection; using System.Xml; using libsecondlife; @@ -329,7 +330,7 @@ namespace OpenSim.Grid.GridServer foreach (KeyValuePair aSim in neighbours) { NeighbourBlock = new Hashtable(); - NeighbourBlock["sim_ip"] = aSim.Value.serverIP.ToString(); + NeighbourBlock["sim_ip"] = Dns.GetHostByName(aSim.Value.serverIP.ToString()).AddressList[0].ToString(); NeighbourBlock["sim_port"] = aSim.Value.serverPort.ToString(); NeighbourBlock["region_locx"] = aSim.Value.regionLocX.ToString(); NeighbourBlock["region_locy"] = aSim.Value.regionLocY.ToString(); @@ -348,7 +349,7 @@ namespace OpenSim.Grid.GridServer neighbour = getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256)); NeighbourBlock = new Hashtable(); - NeighbourBlock["sim_ip"] = neighbour.serverIP; + NeighbourBlock["sim_ip"] = Dns.GetHostByName(neighbour.serverIP).AddressList[0].ToString(); NeighbourBlock["sim_port"] = neighbour.serverPort.ToString(); NeighbourBlock["region_locx"] = neighbour.regionLocX.ToString(); NeighbourBlock["region_locy"] = neighbour.regionLocY.ToString(); @@ -407,7 +408,7 @@ namespace OpenSim.Grid.GridServer else { Console.WriteLine("found region"); - responseData["sim_ip"] = simData.serverIP; + responseData["sim_ip"] = Dns.GetHostByName(simData.serverIP).AddressList[0].ToString(); responseData["sim_port"] = simData.serverPort.ToString(); responseData["http_port"] = simData.httpPort.ToString(); responseData["remoting_port"] = simData.remotingPort.ToString(); @@ -567,7 +568,7 @@ namespace OpenSim.Grid.GridServer respstring += ""; respstring += "" + TheSim.UUID.ToString() + ""; respstring += "" + TheSim.regionName + ""; - respstring += "" + TheSim.serverIP + ""; + respstring += "" + Dns.GetHostByName(TheSim.serverIP).AddressList[0].ToString() + ""; respstring += "" + TheSim.serverPort.ToString() + ""; respstring += "" + TheSim.regionLocX.ToString() + ""; respstring += "" + TheSim.regionLocY.ToString() + ""; diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index bb7d673179..74d2248c00 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -27,6 +27,7 @@ */ using System; using System.Collections; +using System.Net; using Nwc.XmlRpc; using OpenSim.Framework.Data; using OpenSim.Framework.UserManagement; @@ -59,7 +60,7 @@ namespace OpenSim.Grid.UserServer // Destination Console.WriteLine("CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + SimInfo.regionLocY); - response.SimAddress = SimInfo.serverIP; + response.SimAddress = Dns.GetHostByName(SimInfo.serverIP).AddressList[0].ToString(); response.SimPort = (Int32)SimInfo.serverPort; response.RegionX = SimInfo.regionLocX; response.RegionY = SimInfo.regionLocY; diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 5ddad009f3..99e2b20e68 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -117,7 +117,7 @@ namespace OpenSim.Region.Communications.OGS1 uint regY = Convert.ToUInt32(n["y"]); if ((regionInfo.RegionLocX != regX) || (regionInfo.RegionLocY != regY)) { - string externalIpStr = (string)n["sim_ip"]; + string externalIpStr = Dns.GetHostByName((string)n["sim_ip"]).AddressList[0].ToString(); uint port = Convert.ToUInt32(n["sim_port"]); string externalUri = (string)n["sim_uri"];