Changed the way HG client verification is done: now transforming local and LAN client IPs into external IPs. This addresses some issues related to running both the user agents service and the viewer in the same machine/LAN, which then presents a problem when the user agent goes to an external network.

This commit is contained in:
Diva Canto
2010-07-30 14:04:13 -07:00
parent b83910f12a
commit 8ab7d80b09
4 changed files with 84 additions and 9 deletions

View File

@@ -2725,7 +2725,9 @@ namespace OpenSim.Region.Framework.Scenes
IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
if (userVerification != null && ep != null)
{
if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString()))
System.Net.IPAddress addr = NetworkUtil.GetExternalIPOf(ep.Address);
if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString()))
{
// uh-oh, this is fishy
m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);