From 2b172bef7263a7301722a319e93e9066eff6ea76 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 19 Aug 2010 09:14:20 -0700 Subject: [PATCH] Revert "One more go at GetExternalIpOf(user). Addresses mantis #4955 and #4943." Reverting mostly because of the texture asset files that got committed and cause grief with the 0.7-post-fixes branch. But also because I'm going to go at those mantises in another way. This reverts commit e47608fc62647a28be91dd9caf6e446826fdb54c. --- OpenSim/Framework/NetworkUtil.cs | 68 +- .../TexturesAssetSet/TexturesAssetSet.xml | 614 +++++++++--------- bin/assets/TexturesAssetSet/licenses.txt | 40 +- 3 files changed, 355 insertions(+), 367 deletions(-) diff --git a/OpenSim/Framework/NetworkUtil.cs b/OpenSim/Framework/NetworkUtil.cs index 5649131566..831ff70e77 100644 --- a/OpenSim/Framework/NetworkUtil.cs +++ b/OpenSim/Framework/NetworkUtil.cs @@ -274,49 +274,37 @@ namespace OpenSim.Framework } } - // Check for private networks - if (user.ToString().StartsWith("192.168")) + // Check for same LAN segment + foreach (KeyValuePair subnet in m_subnets) { - m_log.Info("[NetworkUtil] Private network user detected, sending '" + externalIPAddress + "' instead of '" + user + "'"); - return externalIPAddress; + byte[] subnetBytes = subnet.Value.GetAddressBytes(); + byte[] localBytes = subnet.Key.GetAddressBytes(); + byte[] destBytes = user.GetAddressBytes(); + + if (subnetBytes.Length != destBytes.Length || subnetBytes.Length != localBytes.Length) + return user; + + bool valid = true; + + for (int i = 0; i < subnetBytes.Length; i++) + { + if ((localBytes[i] & subnetBytes[i]) != (destBytes[i] & subnetBytes[i])) + { + valid = false; + break; + } + } + + if (subnet.Key.AddressFamily != AddressFamily.InterNetwork) + valid = false; + + if (valid) + { + m_log.Info("[NetworkUtil] Local LAN user detected, sending '" + externalIPAddress + "' instead of '" + user + "'"); + return externalIPAddress; + } } - // We may need to do more fancy configuration-based checks... I'm not entirely sure there is - // a 100% algorithmic manner of dealing with all the network setups out there. This code - // will evolve as people bump into problems. - - //// Check for same LAN segment -- I don't think we want to do this in general. Leaving it here - //// for now as a reminder - //foreach (KeyValuePair subnet in m_subnets) - //{ - // byte[] subnetBytes = subnet.Value.GetAddressBytes(); - // byte[] localBytes = subnet.Key.GetAddressBytes(); - // byte[] destBytes = user.GetAddressBytes(); - - // if (subnetBytes.Length != destBytes.Length || subnetBytes.Length != localBytes.Length) - // return user; - - // bool valid = true; - - // for (int i = 0; i < subnetBytes.Length; i++) - // { - // if ((localBytes[i] & subnetBytes[i]) != (destBytes[i] & subnetBytes[i])) - // { - // valid = false; - // break; - // } - // } - - // if (subnet.Key.AddressFamily != AddressFamily.InterNetwork) - // valid = false; - - // if (valid) - // { - // m_log.Info("[NetworkUtil] Local LAN user detected, sending '" + externalIPAddress + "' instead of '" + user + "'"); - // return externalIPAddress; - // } - //} - // Otherwise, return user address return user; } diff --git a/bin/assets/TexturesAssetSet/TexturesAssetSet.xml b/bin/assets/TexturesAssetSet/TexturesAssetSet.xml index c5cafa741e..54f61bd1a3 100644 --- a/bin/assets/TexturesAssetSet/TexturesAssetSet.xml +++ b/bin/assets/TexturesAssetSet/TexturesAssetSet.xml @@ -422,312 +422,312 @@ -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- - -
- - - - -
- -
- - - - +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ + +
+ + + + +
+ +
+ + + +
diff --git a/bin/assets/TexturesAssetSet/licenses.txt b/bin/assets/TexturesAssetSet/licenses.txt index f34d26f89e..4c1364e430 100644 --- a/bin/assets/TexturesAssetSet/licenses.txt +++ b/bin/assets/TexturesAssetSet/licenses.txt @@ -36,24 +36,24 @@ A few of the wood textures were created by me using Wood Workshop. These I donat THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -6. From Second Life(TM) Viewer Artwork. Copyright (C) 2008 Linden Research, Inc. - -Linden Research, Inc. ("Linden Lab") licenses the Second Life viewer -artwork and other works in the files distributed with this Notice under -the Creative Commons Attribution-Share Alike 3.0 License, available at -http://creativecommons.org/licenses/by- sa/3.0/legalcode. For the license -summary, see http://creativecommons.org/licenses/by-sa/3.0/. - -Notwithstanding the foregoing, all of Linden Lab's trademarks, including -but not limited to the Second Life brand name and Second Life Eye-in-Hand -logo, are subject to our trademark policy at -http://secondlife.com/corporate/trademark/. - -If you distribute any copies or adaptations of the Second Life viewer -artwork or any other works in these files, you must include this Notice -and clearly identify any changes made to the original works. Include -this Notice and information where copyright notices are usually included, -for example, after your own copyright notice acknowledging your use of -the Second Life viewer artwork, in a text file distributed with your -program, in your application's About window, or on a credits page for +6. From Second Life(TM) Viewer Artwork. Copyright (C) 2008 Linden Research, Inc. + +Linden Research, Inc. ("Linden Lab") licenses the Second Life viewer +artwork and other works in the files distributed with this Notice under +the Creative Commons Attribution-Share Alike 3.0 License, available at +http://creativecommons.org/licenses/by- sa/3.0/legalcode. For the license +summary, see http://creativecommons.org/licenses/by-sa/3.0/. + +Notwithstanding the foregoing, all of Linden Lab's trademarks, including +but not limited to the Second Life brand name and Second Life Eye-in-Hand +logo, are subject to our trademark policy at +http://secondlife.com/corporate/trademark/. + +If you distribute any copies or adaptations of the Second Life viewer +artwork or any other works in these files, you must include this Notice +and clearly identify any changes made to the original works. Include +this Notice and information where copyright notices are usually included, +for example, after your own copyright notice acknowledging your use of +the Second Life viewer artwork, in a text file distributed with your +program, in your application's About window, or on a credits page for your work.