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 'spoof' and 'spoofRaw' Lua bindings #10073

Merged
merged 5 commits into from Feb 15, 2021

Conversation

rgacogne
Copy link
Member

@rgacogne rgacogne commented Feb 9, 2021

This commits makes it possible to spoof multiple values from Lua:

function myfunc(dq)
  local ret = { newCA("192.0.2.1"), newCA("192.0.2.2") }
  dq:spoof(ret)
  return DNSAction.HeaderModify
end

addAction(AllRule(), LuaAction(myfunc))

Barely tested, need tests and documentation.
Now with documentation and tests courtesy of tjikkun, thanks a lot!

Short description

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)

This commits makes it possible to spoof multiple values from Lua:

```
function myfunc(dq)
  local ret = { newCA("192.0.2.1"), newCA("192.0.2.2") }
  dq:spoof(ret)
  return DNSAction.HeaderModify
end

addAction(AllRule(), LuaAction(myfunc))
```

Barely tested, need tests and documentation.
@rgacogne
Copy link
Member Author

rgacogne commented Feb 9, 2021

It might be better to take a variant instead of having two functions, by the way.

@rgacogne rgacogne merged commit f3082b7 into PowerDNS:master Feb 15, 2021
@rgacogne rgacogne deleted the ddist-spoof-multiple-from-lua branch February 15, 2021 08:23
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

2 participants