diff options
author | lbsa71 | 2007-07-02 06:57:42 +0000 |
---|---|---|
committer | lbsa71 | 2007-07-02 06:57:42 +0000 |
commit | 9ff5bb9873e41936ef3ddb6fcea2f0529e425e52 (patch) | |
tree | 588dd7aa5fcd530b30b64db31a42cf6618fc5431 /OpenSim | |
parent | * worked some more on the RegionInfo attr fuggliness (diff) | |
download | opensim-SC-9ff5bb9873e41936ef3ddb6fcea2f0529e425e52.zip opensim-SC-9ff5bb9873e41936ef3ddb6fcea2f0529e425e52.tar.gz opensim-SC-9ff5bb9873e41936ef3ddb6fcea2f0529e425e52.tar.bz2 opensim-SC-9ff5bb9873e41936ef3ddb6fcea2f0529e425e52.tar.xz |
* Applied Weathros/tedd's IP v6 patch
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/General/Types/RegionInfo.cs | 20 |
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 | ||