From 0b0443687d072bb1d4a4274828a72bbc9a171ede Mon Sep 17 00:00:00 2001 From: Matt Schatz Date: Wed, 10 Jul 2019 02:29:47 -0600 Subject: [PATCH] Skip UNIX sockets in GetLocation(). --- src/modules/extra/m_geo_maxmind.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.39.5