summaryrefslogtreecommitdiff
path: root/src/coremods
diff options
context:
space:
mode:
Diffstat (limited to 'src/coremods')
-rw-r--r--src/coremods/core_hostname_lookup.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/coremods/core_hostname_lookup.cpp b/src/coremods/core_hostname_lookup.cpp
index bf882abf6..ec93732b1 100644
--- a/src/coremods/core_hostname_lookup.cpp
+++ b/src/coremods/core_hostname_lookup.cpp
@@ -199,6 +199,13 @@ class ModuleHostnameLookup : public Module
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)
+ {
+ user->WriteNotice("*** Skipping host resolution (connected via a non-IP socket)");
+ return;
+ }
+
user->WriteNotice("*** Looking up your hostname...");
UserResolver* res_reverse = new UserResolver(*this->DNS, this, user, user->GetIPString(), DNS::QUERY_PTR);