]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Avoid doing "IP changed" event stuff on quitting users.
authorSadie Powell <sadie@witchery.services>
Thu, 19 Nov 2020 19:21:10 +0000 (19:21 +0000)
committerSadie Powell <sadie@witchery.services>
Fri, 20 Nov 2020 12:10:47 +0000 (12:10 +0000)
src/coremods/core_hostname_lookup.cpp
src/modules/m_cloaking.cpp
src/modules/m_connectban.cpp
src/modules/m_dnsbl.cpp
src/modules/m_ident.cpp

index 89c361555f4b8fc17cba0c0bc5c4327c7c1c7b5e..db9063ff630e2d56c81d296c1905fabce665347c 100644 (file)
@@ -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.
index 3f1774e7b88e1c7704893e2b5c5ac3447c6a8ec1..69f376d2c20291b4e9b2a1d489f6ab5d8e6b7995 100644 (file)
@@ -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.
index 09390bb07bc8d4bb6b4776b45b53580533b23481..04a73ab82c49e5da119a0b2aa55b015a5c462dcd 100644 (file)
@@ -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));
index 4873e23220929920c42556d1edbd02464f83438e..37819c05ce0b0b5239e6e0a34d24a3fd5cf72b73 100644 (file)
@@ -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)
index 73dc64cf02dd02be4ddb816e12a802e5ac32b8cf..a0d5443d6050ed606cd0568c0283dec73d77fb0c 100644 (file)
@@ -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;