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 addAction: Also DNSName(s) #5070

Merged

Conversation

pieterlexis
Copy link
Contributor

Short description

This adds the possibility to feed a DNSName, or table of DNSNames to addAction.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled and 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.

Looks good, would be perfect with a short regression test ;)

@@ -91,13 +91,13 @@ class LuaResponseAction : public DNSResponseAction
func_t d_func;
};

typedef boost::variant<string,vector<pair<int, string>>, std::shared_ptr<DNSRule> > luadnsrule_t;
typedef boost::variant<string, vector<pair<int, string>>, std::shared_ptr<DNSRule>, DNSName, vector<pair<int, DNSName>> > luadnsrule_t;
Copy link
Member

Choose a reason for hiding this comment

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

Not your doing but this line should go, it's redundant with the one in dnsdist-lua.hh

@@ -110,11 +110,15 @@ std::shared_ptr<DNSRule> makeRule(const luadnsrule_t& var)
};
if(auto src = boost::get<string>(&var))
add(*src);
else {
for(auto& a : boost::get<vector<pair<int, string>>>(var)) {
else if (auto src = boost::get<vector<pair<int, string>>>(&var))
Copy link
Member

Choose a reason for hiding this comment

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

g++ with -Wshadow is going to complain we declare several src in the same scope, perhaps we could avoid that?

@pieterlexis pieterlexis force-pushed the dnsdist-addAction-accept-DNSName branch from d7fbc2f to dca4478 Compare March 1, 2017 14:50
@pieterlexis
Copy link
Contributor Author

Updated implementation to use typeid and added tests!

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.

Looks very good, Travis failed on the pySNMP / pyasn1 issue again, rebasing should fix that.

@pieterlexis pieterlexis force-pushed the dnsdist-addAction-accept-DNSName branch from dca4478 to f850b03 Compare March 2, 2017 10:35
@rgacogne rgacogne merged commit 22d8fdd into PowerDNS:master Mar 6, 2017
@pieterlexis pieterlexis deleted the dnsdist-addAction-accept-DNSName branch March 6, 2017 09:27
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