diff options
author | Dr Scofield | 2009-05-12 14:57:42 +0000 |
---|---|---|
committer | Dr Scofield | 2009-05-12 14:57:42 +0000 |
commit | c81c9e712c1362721f9e887b53a47c3ce4f40455 (patch) | |
tree | 791b267406bab4e53c0637c59359e70213e112d5 /OpenSim | |
parent | Correctly reset the group ownership flag when a parcel is reclaimed. (diff) | |
download | opensim-SC_OLD-c81c9e712c1362721f9e887b53a47c3ce4f40455.zip opensim-SC_OLD-c81c9e712c1362721f9e887b53a47c3ce4f40455.tar.gz opensim-SC_OLD-c81c9e712c1362721f9e887b53a47c3ce4f40455.tar.bz2 opensim-SC_OLD-c81c9e712c1362721f9e887b53a47c3ce4f40455.tar.xz |
fixing SocketException when IP address cannot be resolved
Diffstat (limited to 'OpenSim')
-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 | } |