mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 18:49:03 -04:00
m_dnsbl Add usednsbl option to connect classes
Don't touch users in classes where it's off
This commit is contained in:
parent
20ea635c9f
commit
f1a122b4ee
@ -271,6 +271,10 @@
|
||||
# maxconnwarn: Enable warnings when localmax or globalmax is hit (defaults to on)
|
||||
maxconnwarn="off"
|
||||
|
||||
# usednsbl: Defines whether or not users in this class are subject to DNSBL. Default is yes.
|
||||
# This setting only has effect when m_dnsbl is loaded.
|
||||
#usednsbl="yes"
|
||||
|
||||
# useident: Defines if users in this class MUST respond to a ident query or not.
|
||||
useident="no"
|
||||
|
||||
|
@ -352,16 +352,21 @@ class ModuleDNSBL : public Module
|
||||
|
||||
void OnSetUserIP(LocalUser* user)
|
||||
{
|
||||
if (user->exempt)
|
||||
if ((user->exempt) || (user->client_sa.sa.sa_family != AF_INET))
|
||||
return;
|
||||
|
||||
if (user->MyClass)
|
||||
{
|
||||
if (!user->MyClass->config->getBool("usednsbl", true))
|
||||
return;
|
||||
}
|
||||
else
|
||||
ServerInstance->Logs->Log("m_dnsbl", DEBUG, "User has no connect class in OnSetUserIP");
|
||||
|
||||
unsigned char a, b, c, d;
|
||||
char reversedipbuf[128];
|
||||
std::string reversedip;
|
||||
|
||||
if (user->client_sa.sa.sa_family != AF_INET)
|
||||
return;
|
||||
|
||||
d = (unsigned char) (user->client_sa.in4.sin_addr.s_addr >> 24) & 0xFF;
|
||||
c = (unsigned char) (user->client_sa.in4.sin_addr.s_addr >> 16) & 0xFF;
|
||||
b = (unsigned char) (user->client_sa.in4.sin_addr.s_addr >> 8) & 0xFF;
|
||||
|
Loading…
x
Reference in New Issue
Block a user