dnsdist addAction: Also DNSName(s) #5070
Merged
Conversation
Looks good, would be perfect with a short regression test ;) |
pdns/dnsdist-lua.cc
Outdated
@@ -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; |
rgacogne
Mar 1, 2017
Member
Not your doing but this line should go, it's redundant with the one in dnsdist-lua.hh
Not your doing but this line should go, it's redundant with the one in dnsdist-lua.hh
pdns/dnsdist-lua.cc
Outdated
@@ -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)) |
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?
g++ with -Wshadow
is going to complain we declare several src
in the same scope, perhaps we could avoid that?
d7fbc2f
to
dca4478
Updated implementation to use |
Looks very good, Travis failed on the pySNMP / pyasn1 issue again, rebasing should fix that. |
dca4478
to
f850b03
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Short description
This adds the possibility to feed a DNSName, or table of DNSNames to addAction.
Checklist
I have: