diff options
author | Peter Powell <petpow@saberuk.com> | 2017-07-09 22:36:40 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2017-07-09 22:45:00 +0100 |
commit | c0aba5b728b0a921d95ec120aa638dab1520b42f (patch) | |
tree | 5470b2e12cc40ba8ea5cafe36fc254c73192cb48 /src/modules/m_cloaking.cpp | |
parent | e97ee390cf1a3f5e897aed85d62e29a34c4632f9 (diff) | |
parent | b7facc2474ff5fb229c66ed130ed67207620f55d (diff) |
Merge v2.0.23 and v2.0.24 into master.
Diffstat (limited to 'src/modules/m_cloaking.cpp')
-rw-r--r-- | src/modules/m_cloaking.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 890c799f2..5cedb5774 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -89,6 +89,10 @@ class CloakUser : public ModeHandler if (adding) { + // assume this is more correct + if (user->registered != REG_ALL && user->host != user->dhost) + return MODEACTION_DENY; + std::string* cloak = ext.get(user); if (!cloak) @@ -343,11 +347,14 @@ class ModuleCloaking : public Module { std::string chost; + irc::sockets::sockaddrs hostip; + bool host_is_ip = irc::sockets::aptosa(host, ip.port(), hostip) && hostip == ip; + switch (mode) { case MODE_HALF_CLOAK: { - if (ipstr != host) + if (!host_is_ip) chost = prefix + SegmentCloak(host, 1, 6) + LastTwoDomainParts(host); if (chost.empty() || chost.length() > 50) chost = SegmentIP(ip, false); |