Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rec: fix setting of policy tags #13021

Merged
merged 5 commits into from Jul 20, 2023
Merged

Conversation

omoerbeek
Copy link
Member

@omoerbeek omoerbeek commented Jul 12, 2023

Short description

As gettag can add protobuf policy tags, we do not want to cache the protobuf policy tags stored (and therefore fixed) in the packet cache.
Also, set SocketFamily always (was missing on a cache hit).

This is a Draft PR, as the current state of this PR changes behaviour if policy tags are set in an interception function (e.g. postResolve) later in the resolving process. In that case the policy tags should en up in the packet cache. I have to think a bit how to arrange that, and what to do if gettag also add tags for a case that does have policy tags stored already in the packet cache.

Reported by @wojas

Follow-up: we now keep track of the tags set by gettag(_ffi) separately. This allows for them to not end up in the PC.
Do pass the tags set by gettag(_ffi) to other other Lua functions, they might expect to see them and use them for conditional processing.
Before constructing the partial protobuf message that gets stored into the PC, we strip the tags set by gettag(_ffi) from the set to be stored into the PC.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

pdns/recursordist/pdns_recursor.cc Outdated Show resolved Hide resolved
pdns/recursordist/pdns_recursor.cc Show resolved Hide resolved
omoerbeek and others added 5 commits July 20, 2023 10:28
…arate.

We do pass them to the other Lua functions, but take care to erase them
aagin before creating the partial PB message stored into the cache.
Co-authored-by: Remi Gacogne <github@coredump.fr>
Copy link
Member

@wojas wojas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Also tested and confirmed that this resolves the issue.

@omoerbeek omoerbeek merged commit 17a0f49 into PowerDNS:master Jul 20, 2023
74 checks passed
@omoerbeek omoerbeek deleted the rec-pb-cache-tags branch July 20, 2023 09:14
omoerbeek added a commit to omoerbeek/pdns that referenced this pull request Jul 20, 2023
omoerbeek added a commit to omoerbeek/pdns that referenced this pull request Jul 20, 2023
omoerbeek added a commit to omoerbeek/pdns that referenced this pull request Jul 20, 2023
omoerbeek added a commit to omoerbeek/pdns that referenced this pull request Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants