summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorMatt Schatz <genius3000@g3k.solutions>2019-07-10 02:29:47 -0600
committerPeter Powell <petpow@saberuk.com>2019-07-10 10:23:42 +0100
commit0b0443687d072bb1d4a4274828a72bbc9a171ede (patch)
tree5305f5fcde5af772c3b0e8a1dc427746bc71ae3c /src/modules
parent9c56619ea95538180ab7822c81b5a6b21b485314 (diff)
Skip UNIX sockets in GetLocation().
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_geo_maxmind.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/modules/extra/m_geo_maxmind.cpp b/src/modules/extra/m_geo_maxmind.cpp
index e57908a77..6f84f31a3 100644
--- a/src/modules/extra/m_geo_maxmind.cpp
+++ b/src/modules/extra/m_geo_maxmind.cpp
@@ -97,6 +97,10 @@ class GeolocationAPIImpl : public Geolocation::APIBase
Geolocation::Location* GetLocation(irc::sockets::sockaddrs& sa) CXX11_OVERRIDE
{
+ // Skip trying to look up a UNIX socket.
+ if (sa.family() != AF_INET && sa.family() != AF_INET6)
+ return NULL;
+
// Attempt to look up the socket address.
int result;
MMDB_lookup_result_s lookup = MMDB_lookup_sockaddr(&mmdb, &sa.sa, &result);