X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_ident.cpp;h=803c19846288e67dd93be7f5fac9a8ce6570a860;hb=965c81baee0fb6f46aa788f45742d558f50c8b15;hp=f645a77ffb74eb7ce83a8c3ace29bd862f9d4d4d;hpb=87e328a1fbfcacafc013ba580d31dd4123f1e7e2;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index f645a77ff..803c19846 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -275,8 +275,24 @@ class ModuleIdent : public Module NoLookupPrefix = tag->getBool("nolookupprefix", false); } - void OnUserInit(LocalUser *user) CXX11_OVERRIDE + void OnSetUserIP(LocalUser* user) CXX11_OVERRIDE { + IdentRequestSocket* isock = ext.get(user); + if (isock) + { + // If an ident lookup request was in progress then cancel it. + isock->Close(); + ext.unset(user); + } + + // The ident protocol requires that clients are connecting over a protocol with ports. + if (user->client_sa.family() != AF_INET && user->client_sa.family() != AF_INET6) + return; + + // We don't want to look this up once the user has connected. + if (user->registered == REG_ALL) + return; + ConfigTag* tag = user->MyClass->config; if (!tag->getBool("useident", true)) return; @@ -285,7 +301,7 @@ class ModuleIdent : public Module try { - IdentRequestSocket *isock = new IdentRequestSocket(user); + isock = new IdentRequestSocket(user); ext.set(user, isock); } catch (ModuleException &e)