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

Handle bracketed IPv6 addresses without ports #6057

Merged
merged 2 commits into from Dec 8, 2017
Merged

Conversation

@zeha
Copy link
Collaborator

@zeha zeha commented Dec 5, 2017

dnsdist's newServer source parameter is documented to take values
of those forms (plus some more):

  • v4 address ("192.0.2.1")
  • v6 address ("2001:DB8::1")

For consistency, bracketed addresses ("[2001:DB8::1]") should work too, and all of them
should have a test.

Example that would previously "fail":

newServer({name="pdns", address="[::1]:5300", source="[::1]"}):setUp()

Gives:

Dismissing source [::1] because '[::1]' is not a valid interface name
Added downstream server [::1]:5300

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)
dnsdist's newServer source parameter is documented to take values
of those forms (plus some more):
  - v4 address ("192.0.2.1")
  - v6 address ("2001:DB8::1")

For consistency, bracketed addresses should work too, and all of them
should have a test.
@zeha zeha requested a review from rgacogne Dec 5, 2017
Copy link
Member

@rgacogne rgacogne left a comment

Looks good to me!

catch(std::out_of_range) {
return -1;
if (pos + 1 == addr.size()) {
port = 0;

This comment has been minimized.

@rgacogne

rgacogne Dec 6, 2017
Member

It looks like setting port to 0 without setting portSet to true is useless?

This comment has been minimized.

@zeha

zeha Dec 6, 2017
Author Collaborator

Hmmm yes. Will change that if()...

This comment has been minimized.

@zeha

zeha Dec 6, 2017
Author Collaborator

@rgacogne fixed this!

@rgacogne rgacogne merged commit f50f10a into PowerDNS:master Dec 8, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@zeha zeha deleted the zeha:combo-ipv6 branch Jan 29, 2018
rgacogne added a commit to rgacogne/pdns that referenced this pull request Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants