summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-10-24 15:14:35 +0100
committerPeter Powell <petpow@saberuk.com>2019-10-24 15:56:20 +0100
commit0d2f3cdc51082eb79731d1438da7b3fe2da6cf58 (patch)
tree2913919ca5dfe5fd4d0ced00f1106344574d7ed2 /src/modules
parent2e75491aed528e63a3b1bcbe76483e395f8c2506 (diff)
Ignore DNSBL responses if the user's IP address has changed.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_dnsbl.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp
index c9be107b8..484f5e434 100644
--- a/src/modules/m_dnsbl.cpp
+++ b/src/modules/m_dnsbl.cpp
@@ -47,15 +47,21 @@ class DNSBLConfEntry : public refcountbase
*/
class DNSBLResolver : public DNS::Request
{
+ private:
+ irc::sockets::sockaddrs theirsa;
std::string theiruid;
LocalStringExt& nameExt;
LocalIntExt& countExt;
reference<DNSBLConfEntry> ConfEntry;
public:
-
DNSBLResolver(DNS::Manager *mgr, Module *me, LocalStringExt& match, LocalIntExt& ctr, const std::string &hostname, LocalUser* u, reference<DNSBLConfEntry> conf)
- : DNS::Request(mgr, me, hostname, DNS::QUERY_A, true), theiruid(u->uuid), nameExt(match), countExt(ctr), ConfEntry(conf)
+ : DNS::Request(mgr, me, hostname, DNS::QUERY_A, true)
+ , theirsa(u->client_sa)
+ , theiruid(u->uuid)
+ , nameExt(match)
+ , countExt(ctr)
+ , ConfEntry(conf)
{
}
@@ -64,7 +70,7 @@ class DNSBLResolver : public DNS::Request
{
/* Check the user still exists */
LocalUser* them = IS_LOCAL(ServerInstance->FindUUID(theiruid));
- if (!them)
+ if (!them || them->client_sa != theirsa)
return;
const DNS::ResourceRecord* const ans_record = r->FindAnswerOfType(DNS::QUERY_A);
@@ -210,7 +216,7 @@ class DNSBLResolver : public DNS::Request
void OnError(const DNS::Query *q) CXX11_OVERRIDE
{
LocalUser* them = IS_LOCAL(ServerInstance->FindUUID(theiruid));
- if (!them)
+ if (!them || them->client_sa != theirsa)
return;
int i = countExt.get(them);