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: Mark the remote member of DownstreamState as const #6688

merged 2 commits into from May 29, 2018


None yet
2 participants

rgacogne commented May 29, 2018

Short description

While investigating #6664, I noticed that we pass the remote member to functions that could alter it, like Socket::recvFrom(). At the moment I don't see how it could have led to having a different port in the end, since we use a connected socket, but it's still not very clean.
As there is no reason to alter remote and some other members after the object construction, this PR marks them as const so we are prevented from passing them to a function that might alter their content.


I have:

  • read the 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)

rgacogne added some commits May 28, 2018

@rgacogne rgacogne added the dnsdist label May 29, 2018

@rgacogne rgacogne added this to the dnsdist-1.3.x milestone May 29, 2018


zeha approved these changes May 29, 2018

@rgacogne rgacogne merged commit b7bf243 into PowerDNS:master May 29, 2018

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
lgtm analysis: C/C++ No alert changes
lgtm analysis: JavaScript No alert changes
lgtm analysis: Python No alert changes

@rgacogne rgacogne deleted the rgacogne:dnsdist-const-ds-remote branch May 29, 2018

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