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: avoid LuaWrapper assert on errors in newServer() #6403

Merged
merged 1 commit into from Mar 28, 2018

Conversation

Projects
None yet
2 participants
@zeha
Collaborator

zeha commented Mar 27, 2018

Short description

Calling newServer with something like "foo:53" would previously end up like this (at least in assert-enabled builds):

Error creating new server with address :53: Unable to convert presentation address ':53'
Assertion failed: (obj), function operator(), file ./ext/luawrapper/include/LuaContext.hpp, line 1149.
./run-dist: line 3: 18014 Abort trap: 6           ../../pdns/pdns/dnsdistdist/dnsdist --config dnsdist.lua

After this change:

Error creating new server with address :53: Unable to convert presentation address ':53'
Listening on 127.0.0.1:5400
...

IIRC running newServer from a remote console this would also crash the daemon process.

I have to say that starting up with the invalid newServer is bad, but judging by the code this was the intended behaviour.

I've pushed the if(client) branching down, so that under --check-config at least the addresses are parsed, and not silently being ignored. Therefore:

% ./run-dist --check-config
Error creating new server with address :53: Unable to convert presentation address ':53'
Configuration 'dnsdist.lua' OK!

Similarly:

% ./run-dist --check-config
Dismissing source 1.1.1.1@lol because 'lol' is not a valid interface name
Configuration 'dnsdist.lua' OK!

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 very good to me, thanks!

@rgacogne rgacogne added this to the dnsdist-1.3.0 milestone Mar 27, 2018

@rgacogne rgacogne merged commit a2226f6 into PowerDNS:master Mar 28, 2018

1 check passed

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

@rgacogne rgacogne referenced this pull request Mar 29, 2018

Merged

dnsdist: Add 1.3.0 changelog #6388

3 of 6 tasks complete

@zeha zeha deleted the zeha:dnsdist-newserver-assert branch Jul 11, 2018

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