aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/General/Types/RegionInfo.cs20
1 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs
index 69a941e..7b99d06 100644
--- a/OpenSim/Framework/General/Types/RegionInfo.cs
+++ b/OpenSim/Framework/General/Types/RegionInfo.cs
@@ -55,7 +55,25 @@ namespace OpenSim.Framework.Types
55 { 55 {
56 get 56 get
57 { 57 {
58 return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port ); 58 // Old one defaults to IPv6
59 //return new IPEndPoint( Dns.GetHostAddresses( m_externalHostName )[0], m_internalEndPoint.Port );
60
61 // New method favors IPv4
62 IPAddress ia = null;
63 foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
64 {
65 if (ia == null)
66 ia = Adr;
67
68 if (Adr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
69 {
70 ia = Adr;
71 break;
72 }
73
74 }
75
76 return new IPEndPoint(ia, m_internalEndPoint.Port);
59 } 77 }
60 } 78 }
61 79