From 8792645e0da7f47ff7acd764b0855cd780d00d66 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Mon, 17 Sep 2007 08:06:20 +0000 Subject: Forgot to check in prebuild.xml on sat, see someone already did :) Fix in DNS resolve --- OpenSim/Framework/General/Types/RegionInfo.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim') 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 // Old one defaults to IPv6 //return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); - // New method favors IPv4 IPAddress ia = null; + // If it is already an IP, don't resolve it - just return directly + if (IPAddress.TryParse(m_externalHostName, out ia)) + return new IPEndPoint(ia, m_internalEndPoint.Port); + + // Reset for next check + ia = null; + + + // New method favors IPv4 foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) { if (ia == null) @@ -188,7 +196,7 @@ namespace OpenSim.Framework.Types { errorMessage = "needs an IP Address (IPAddress)"; } - this.m_internalEndPoint.Port = source.Configs[sectionName].GetInt("internal_ip_port",(int) 9000); + this.m_internalEndPoint.Port = source.Configs[sectionName].GetInt("internal_ip_port", (int)9000); string externalHost = source.Configs[sectionName].GetString("external_host_name", "127.0.0.1"); if (externalHost != "SYSTEMIP") -- cgit v1.1