diff --git a/OpenSim/Framework/NetworkUtil.cs b/OpenSim/Framework/NetworkUtil.cs index 1abf0d85eb..759c52f8d2 100644 --- a/OpenSim/Framework/NetworkUtil.cs +++ b/OpenSim/Framework/NetworkUtil.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Net.Sockets; using System.Net; using System.Net.NetworkInformation; @@ -65,8 +66,15 @@ namespace OpenSim.Framework return subnet.Key; } - // None found. Assume outside network. - return null; + // Check to see if we can find a IPv4 address. + foreach (IPAddress host in Dns.GetHostAddresses(defaultHostname)) + { + if (host.AddressFamily == AddressFamily.InterNetwork) + return host; + } + + // Unable to find anything. + throw new ArgumentException("[NetworkUtil] Unable to resolve defaultHostname to an IPv4 address for an IPv4 client"); } static NetworkUtil() diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 3067d757ac..684d42b287 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -31,7 +31,6 @@ using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Reflection; -using System.Security.Authentication; using log4net; using Nwc.XmlRpc; using OpenMetaverse;