From 5ade01bb493919c65eb3a9c0fc3f76710eea018c Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Wed, 12 Sep 2007 05:37:46 +0000 Subject: Fixed DNS resolve bug for Grid mode on multi-Homer systems. --- OpenSim/Framework/General/Util.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs index a263d7e..fe4ce29 100644 --- a/OpenSim/Framework/General/Util.cs +++ b/OpenSim/Framework/General/Util.cs @@ -249,6 +249,13 @@ namespace OpenSim.Framework.Utilities /// An IP address, or null public static IPAddress GetHostFromDNS(string dnsAddress) { + + // Is it already a valid IP? No need to look it up. + IPAddress ipa; + if (IPAddress.TryParse(dnsAddress, out ipa)) + return ipa; + + // Not an IP, lookup required IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList; foreach (IPAddress host in hosts) -- cgit v1.1