]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_geo_maxmind.cpp
Only send ACCOUNT and CHGHOST to clients that have sent NICK/USER.
[user/henk/code/inspircd.git] / src / modules / extra / m_geo_maxmind.cpp
index e57908a77028afafcd7caeec6253d044b40c4dab..767d0011469c6d4fbff6c7c8656fc8c37a13f545 100644 (file)
@@ -19,6 +19,7 @@
 /// $CompilerFlags: find_compiler_flags("libmaxminddb" "")
 /// $LinkerFlags: find_linker_flags("libmaxminddb" "-lmaxminddb")
 
+/// $PackageInfo: require_system("arch") libmaxminddb pkgconf
 /// $PackageInfo: require_system("darwin") libmaxminddb pkg-config
 /// $PackageInfo: require_system("debian" "9.0") libmaxminddb-dev pkg-config
 /// $PackageInfo: require_system("ubuntu" "16.04") libmaxminddb-dev pkg-config
@@ -97,6 +98,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);