summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-11-19 19:21:10 +0000
committerSadie Powell <sadie@witchery.services>2020-11-20 12:10:47 +0000
commitd4685e02b55229e0ca5068b839c87b5a80180f33 (patch)
tree76a9f59f6d9b103eb63397ceb26c8245b15b6a5f
parentcc5965c45d2bccb6bd440aafb6bebfb98520ddd6 (diff)
Avoid doing "IP changed" event stuff on quitting users.
-rw-r--r--src/coremods/core_hostname_lookup.cpp2
-rw-r--r--src/modules/m_cloaking.cpp2
-rw-r--r--src/modules/m_connectban.cpp2
-rw-r--r--src/modules/m_dnsbl.cpp5
-rw-r--r--src/modules/m_ident.cpp2
5 files changed, 8 insertions, 5 deletions
diff --git a/src/coremods/core_hostname_lookup.cpp b/src/coremods/core_hostname_lookup.cpp
index 89c361555..db9063ff6 100644
--- a/src/coremods/core_hostname_lookup.cpp
+++ b/src/coremods/core_hostname_lookup.cpp
@@ -177,7 +177,7 @@ class ModuleHostnameLookup : public Module
{
// If core_dns is not loaded or hostname resolution is disabled for the user's
// connect class then the logic in this function does not apply.
- if (!DNS || !user->MyClass->resolvehostnames)
+ if (!DNS || user->quitting || !user->MyClass->resolvehostnames)
return;
// Clients can't have a DNS hostname if they aren't connected via IPv4 or IPv6.
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index 3f1774e7b..69f376d2c 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -493,7 +493,7 @@ class ModuleCloaking : public Module
void OnSetUserIP(LocalUser* user) CXX11_OVERRIDE
{
// Connecting users are handled in OnUserConnect not here.
- if (user->registered != REG_ALL)
+ if (user->registered != REG_ALL || user->quitting)
return;
// Remove the cloaks and generate new ones.
diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp
index 09390bb07..04a73ab82 100644
--- a/src/modules/m_connectban.cpp
+++ b/src/modules/m_connectban.cpp
@@ -105,7 +105,7 @@ class ModuleConnectBan
void OnSetUserIP(LocalUser* u) CXX11_OVERRIDE
{
- if (u->exempt)
+ if (u->exempt || u->quitting)
return;
irc::sockets::cidr_mask mask(u->client_sa, GetRange(u));
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp
index 4873e2322..37819c05c 100644
--- a/src/modules/m_dnsbl.cpp
+++ b/src/modules/m_dnsbl.cpp
@@ -357,7 +357,7 @@ class ModuleDNSBL : public Module, public Stats::EventListener
void OnSetUserIP(LocalUser* user) CXX11_OVERRIDE
{
- if ((user->exempt) || !DNS)
+ if (user->exempt || user->quitting || !DNS)
return;
// Clients can't be in a DNSBL if they aren't connected via IPv4 or IPv6.
@@ -370,7 +370,10 @@ class ModuleDNSBL : public Module, public Stats::EventListener
return;
}
else
+ {
ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "User has no connect class in OnSetUserIP");
+ return;
+ }
std::string reversedip;
if (user->client_sa.family() == AF_INET)
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp
index 73dc64cf0..a0d5443d6 100644
--- a/src/modules/m_ident.cpp
+++ b/src/modules/m_ident.cpp
@@ -331,7 +331,7 @@ class ModuleIdent : public Module
return;
// We don't want to look this up once the user has connected.
- if (user->registered == REG_ALL)
+ if (user->registered == REG_ALL || user->quitting)
return;
ConfigTag* tag = user->MyClass->config;