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
merged 1 commit into from Mar 6, 2017

Conversation

Projects
None yet
2 participants
@pieterlexis
Member

pieterlexis commented Feb 22, 2017

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)
@rgacogne

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;

This comment has been minimized.

@rgacogne

rgacogne Mar 1, 2017

Member

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))

This comment has been minimized.

@rgacogne

rgacogne Mar 1, 2017

Member

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 pieterlexis:dnsdist-addAction-accept-DNSName branch from d7fbc2f to dca4478 Mar 1, 2017

@pieterlexis

This comment has been minimized.

Member

pieterlexis commented Mar 1, 2017

Updated implementation to use typeid and added tests!

@rgacogne

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

@pieterlexis pieterlexis force-pushed the pieterlexis:dnsdist-addAction-accept-DNSName branch from dca4478 to f850b03 Mar 2, 2017

@rgacogne rgacogne merged commit 22d8fdd into PowerDNS:master Mar 6, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@pieterlexis pieterlexis deleted the pieterlexis:dnsdist-addAction-accept-DNSName branch Mar 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment