aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/General/Types/RegionInfo.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs
index dadc63d..c1e040d 100644
--- a/OpenSim/Framework/General/Types/RegionInfo.cs
+++ b/OpenSim/Framework/General/Types/RegionInfo.cs
@@ -61,8 +61,16 @@ namespace OpenSim.Framework.Types
61 // Old one defaults to IPv6 61 // Old one defaults to IPv6
62 //return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); 62 //return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port );
63 63
64 // New method favors IPv4
65 IPAddress ia = null; 64 IPAddress ia = null;
65 // If it is already an IP, don't resolve it - just return directly
66 if (IPAddress.TryParse(m_externalHostName, out ia))
67 return new IPEndPoint(ia, m_internalEndPoint.Port);
68
69 // Reset for next check
70 ia = null;
71
72
73 // New method favors IPv4
66 foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) 74 foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
67 { 75 {
68 if (ia == null) 76 if (ia == null)
@@ -188,7 +196,7 @@ namespace OpenSim.Framework.Types
188 { 196 {
189 errorMessage = "needs an IP Address (IPAddress)"; 197 errorMessage = "needs an IP Address (IPAddress)";
190 } 198 }
191 this.m_internalEndPoint.Port = source.Configs[sectionName].GetInt("internal_ip_port",(int) 9000); 199 this.m_internalEndPoint.Port = source.Configs[sectionName].GetInt("internal_ip_port", (int)9000);
192 200
193 string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1"); 201 string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1");
194 if (externalHost != "SYSTEMIP") 202 if (externalHost != "SYSTEMIP")