]> git.ipfire.org Git - thirdparty/pdns.git/commit - pdns/syncres.cc
rec: Add custom tags to RPZ hits
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 13 Mar 2020 14:33:47 +0000 (15:33 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 18 Mar 2020 09:26:44 +0000 (10:26 +0100)
commitb502d5221e4f64a3b6538530f4025032a986b116
tree63c3ccf0ccce17cc798f8544bd8a7e65e3d979d1
parentbbdaaa7e750fc3b1cf861ac8bcdf50b878c3cd7c
rec: Add custom tags to RPZ hits

This commit adds the possibility to set custom tags to a RPZ zone,
adding these tags to the policy ones (that can be set with Lua)
when a policy matches.
It does so by creating a new PolicyZoneData object that is shared
between the zone and all the policies that it holds, in order to
- avoid duplicating the name, priority and tags for each policy ;
- prevent a circular dependency between shared pointers for the zone
and its policies.

It also refactors the handling of RPZ policy hits in `startDoResolve()`
to remove some code duplication.
15 files changed:
pdns/filterpo.cc
pdns/filterpo.hh
pdns/lua-recursor4.cc
pdns/lua-recursor4.hh
pdns/pdns_recursor.cc
pdns/rec-lua-conf.cc
pdns/rec-protobuf.cc
pdns/rec-protobuf.hh
pdns/recursordist/docs/lua-config/rpz.rst
pdns/recursordist/test-filterpo_cc.cc
pdns/rpzloader.cc
pdns/syncres.cc
pdns/syncres.hh
pdns/ws-recursor.cc
regression-tests.recursor-dnssec/test_Protobuf.py