From 6c4d0ab4cdb2fc73e73faba31fd8c3fe909e250a Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 8 Jan 2019 16:05:28 +0100 Subject: [PATCH] rec: Call the ipfilter hook if any over TCP as well --- pdns/pdns_recursor.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 57f69edc5..75486f914 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1542,9 +1542,9 @@ static void handleRunningTCPQuestion(int fd, FDMultiplexer::funcparam_t& var) dc->d_uuid = (*t_uuidGenerator)(); } + const struct dnsheader* dh = (const struct dnsheader*) conn->data; if(luaconfsLocal->protobufServer) { try { - const struct dnsheader* dh = (const struct dnsheader*) conn->data; if (!luaconfsLocal->protobufTaggedOnly) { protobufLogQuery(luaconfsLocal->protobufServer, luaconfsLocal->protobufMaskV4, luaconfsLocal->protobufMaskV6, dc->d_uuid, conn->d_remote, dest, dc->d_ednssubnet.source, true, dh->id, conn->qlen, qname, qtype, qclass, dc->d_policyTags, dc->d_requestorId, dc->d_deviceId); @@ -1556,6 +1556,16 @@ static void handleRunningTCPQuestion(int fd, FDMultiplexer::funcparam_t& var) } } #endif + if(t_pdl) { + if(t_pdl->ipfilter(dc->d_remote, dc->d_local, *dh)) { + delete dc; + if(!g_quiet) + L<getTid()<<"/"<numProcesses()<<"] DROPPED TCP question from "<d_remote.toStringWithPort()<<" based on policy"<d_mdp.d_header.qr) { delete dc; g_stats.ignoredCount++; -- 2.49.0