]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_hostname_lookup.cpp
Only show UHNAMES and NAMESX in 005 if the cap module is loaded.
[user/henk/code/inspircd.git] / src / coremods / core_hostname_lookup.cpp
index bf882abf63eb03742eb4d904315a74376637939a..85d0f530c58bd3c5d9903cedb7f71d94577a29c8 100644 (file)
@@ -193,11 +193,14 @@ class ModuleHostnameLookup : public Module
 
        void OnSetUserIP(LocalUser* user) CXX11_OVERRIDE
        {
+               // 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)
-               {
-                       user->WriteNotice("*** Skipping host resolution (disabled by server administrator)");
                        return;
-               }
+
+               // Clients can't have a DNS hostname if they aren't connected via IPv4 or IPv6.
+               if (user->client_sa.family() != AF_INET && user->client_sa.family() != AF_INET6)
+                       return;
 
                user->WriteNotice("*** Looking up your hostname...");