fixing SocketException when IP address cannot be resolved
parent
68da7d1a43
commit
c81c9e712c
|
@ -27,6 +27,8 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan
|
||||||
{
|
{
|
||||||
IPAddress end = ipEndpoint.EndPoint;
|
IPAddress end = ipEndpoint.EndPoint;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
IPHostEntry rDNS = Dns.GetHostEntry(end);
|
IPHostEntry rDNS = Dns.GetHostEntry(end);
|
||||||
foreach (string ban in bans)
|
foreach (string ban in bans)
|
||||||
{
|
{
|
||||||
|
@ -38,7 +40,12 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_log.Warn("[IPBAN] User '" + end + "' not in any ban lists. Allowing connection.");
|
}
|
||||||
|
catch (System.Net.Sockets.SocketException sex)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[IPBAN] IP address \"{0}\" cannot be resolved via DNS", end);
|
||||||
|
}
|
||||||
|
m_log.WarnFormat("[IPBAN] User \"{0}\" not in any ban lists. Allowing connection.", end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue