aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/NetworkUtil.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/NetworkUtil.cs')
-rw-r--r--OpenSim/Framework/NetworkUtil.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/OpenSim/Framework/NetworkUtil.cs b/OpenSim/Framework/NetworkUtil.cs
index d4fc1e2..328d3bc 100644
--- a/OpenSim/Framework/NetworkUtil.cs
+++ b/OpenSim/Framework/NetworkUtil.cs
@@ -73,9 +73,8 @@ namespace OpenSim.Framework
73 73
74 private static IPAddress GetExternalIPFor(IPAddress destination, string defaultHostname) 74 private static IPAddress GetExternalIPFor(IPAddress destination, string defaultHostname)
75 { 75 {
76 bool ipv6 = false;
77 // Adds IPv6 Support (Not that any of the major protocols supports it...) 76 // Adds IPv6 Support (Not that any of the major protocols supports it...)
78 if (ipv6 && destination.AddressFamily == AddressFamily.InterNetworkV6) 77 if (destination.AddressFamily == AddressFamily.InterNetworkV6)
79 { 78 {
80 foreach (IPAddress host in Dns.GetHostAddresses(defaultHostname)) 79 foreach (IPAddress host in Dns.GetHostAddresses(defaultHostname))
81 { 80 {
@@ -91,10 +90,14 @@ namespace OpenSim.Framework
91 return null; 90 return null;
92 91
93 // Check if we're accessing localhost. 92 // Check if we're accessing localhost.
94 foreach (IPAddress host in Dns.GetHostAddresses(Dns.GetHostName())) 93 foreach (KeyValuePair<IPAddress, IPAddress> pair in m_subnets)
95 { 94 {
95 IPAddress host = pair.Value;
96 if (host.Equals(destination) && host.AddressFamily == AddressFamily.InterNetwork) 96 if (host.Equals(destination) && host.AddressFamily == AddressFamily.InterNetwork)
97 {
98 m_log.Info("[NATROUTING] Localhost user detected, sending them '" + host + "' instead of '" + defaultHostname + "'");
97 return destination; 99 return destination;
100 }
98 } 101 }
99 102
100 // Check for same LAN segment 103 // Check for same LAN segment