* Applied Weathros/tedd's IP v6 patch
parent
d78f6505e3
commit
9ff5bb9873
|
@ -55,7 +55,25 @@ namespace OpenSim.Framework.Types
|
|||
{
|
||||
get
|
||||
{
|
||||
return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port );
|
||||
// Old one defaults to IPv6
|
||||
//return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port );
|
||||
|
||||
// New method favors IPv4
|
||||
IPAddress ia = null;
|
||||
foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
|
||||
{
|
||||
if (ia == null)
|
||||
ia = Adr;
|
||||
|
||||
if (Adr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
|
||||
{
|
||||
ia = Adr;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return new IPEndPoint(ia, m_internalEndPoint.Port);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue