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

dnsdist: add lua support for SetEDNSOptionAction #10814

Merged
merged 2 commits into from
Oct 12, 2021

Conversation

chbruyand
Copy link
Member

Short description

This adds support for lua SetEDNSOptionAction. This allows to set arbitrary EDNS option and content to the query.
Fix #3688

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)

Copy link
Member

@rgacogne rgacogne left a comment

Choose a reason for hiding this comment

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

Nice work, thanks! I think we need to fix the dq.ednsAdded part before merging, and perhaps add a test for that. The other suggestion might not be easy, and even if it is I'm of course okay with postponing that for a different PR.

pdns/dnsdist-lua-actions.cc Show resolved Hide resolved
DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
{
if (dq->getHeader()->arcount) {
return Action::None;
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we could easily refactor slowRewriteQueryWithRecords (dnsdist-ecs.cc) to handle that case as well?

@rgacogne rgacogne added this to the dnsdist-1.7.0-alpha2 milestone Oct 6, 2021
@rgacogne rgacogne merged commit 311b153 into PowerDNS:master Oct 12, 2021
@chbruyand chbruyand deleted the dnsdist-setednsoptionaction branch January 19, 2024 10:53
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.

dnsdist: allow dynamic EDNS option stuffing
2 participants