diff options
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs b/OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs index 1d8da46..20a2159 100644 --- a/OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs +++ b/OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs | |||
@@ -27,18 +27,25 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan | |||
27 | { | 27 | { |
28 | IPAddress end = ipEndpoint.EndPoint; | 28 | IPAddress end = ipEndpoint.EndPoint; |
29 | 29 | ||
30 | IPHostEntry rDNS = Dns.GetHostEntry(end); | 30 | try |
31 | foreach (string ban in bans) | ||
32 | { | 31 | { |
33 | if (rDNS.HostName.Contains(ban) || | 32 | IPHostEntry rDNS = Dns.GetHostEntry(end); |
34 | end.ToString().StartsWith(ban)) | 33 | foreach (string ban in bans) |
35 | { | 34 | { |
36 | client.Disconnect("Banned - network \"" + ban + "\" is not allowed to connect to this server."); | 35 | if (rDNS.HostName.Contains(ban) || |
37 | m_log.Warn("[IPBAN] Disconnected '" + end + "' due to '" + ban + "' ban."); | 36 | end.ToString().StartsWith(ban)) |
38 | return; | 37 | { |
38 | client.Disconnect("Banned - network \"" + ban + "\" is not allowed to connect to this server."); | ||
39 | m_log.Warn("[IPBAN] Disconnected '" + end + "' due to '" + ban + "' ban."); | ||
40 | return; | ||
41 | } | ||
39 | } | 42 | } |
40 | } | 43 | } |
41 | m_log.Warn("[IPBAN] User '" + end + "' not in any ban lists. Allowing connection."); | 44 | catch (System.Net.Sockets.SocketException sex) |
45 | { | ||
46 | m_log.WarnFormat("[IPBAN] IP address \"{0}\" cannot be resolved via DNS", end); | ||
47 | } | ||
48 | m_log.WarnFormat("[IPBAN] User \"{0}\" not in any ban lists. Allowing connection.", end); | ||
42 | } | 49 | } |
43 | } | 50 | } |
44 | } | 51 | } |