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

nghttp2-asio: resolve numeric IPv6 server address #768

Closed
wants to merge 1 commit into from

Conversation

sgsx3
Copy link

@sgsx3 sgsx3 commented Oct 26, 2024

The boost library refuses to resolve a numeric IPv6 host (::1) because its resolver flags are set to 'address_configured' by default. This patch simply runs an additional query in such a case with flags set to 'numeric_host'.

See https://www.boost.org/doc/libs/1_83_0/doc/html/boost_asio/reference/ip__resolver_base.html for more info.

Description

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

The boost library refuses to resolve a numeric IPv6 host (::1) because its resolver flags are set to 'address_configured' by default.
This patch simply runs an additional query in such a case with flags set to 'numeric_host'.

See https://www.boost.org/doc/libs/1_83_0/doc/html/boost_asio/reference/ip__resolver_base.html for more info.

Signed-off-by: Stefan Schlosser <[email protected]>
Copy link
Contributor

@mattiaswal mattiaswal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! This bug really haunts me on the nights, if this is the fix, why does it work for us to resolve with our aarch64 platform (and on x86).

So much unclear right now, have you reproduced it on x86 (Virtual)?

But during the exploring of this bug we at least found a related bug:
the /etc/hosts file does not mention ::1 (as it should)

Just some small things:

@troglobit
Copy link
Contributor

Agreed, very weird that it works in our primary use-cases when we completely remove all IPv6 addresses except the one on loopback 🤔

@sgsx3 please also update the ChangeLog, and tick the boxes in the checklist. Maybe a bit formal, but we've tried to make it so we can follow changes back to issues when looking for future bugs (answers the question: "why is this code here?"). We've tried to outline this in the Contributing Guidelines. Thanks!

@mattiaswal
Copy link
Contributor

Does it work if you use an IPv4 address, (change in rousette main.cpp to 127.0.0.1 or localhost)

@sgsx3 sgsx3 closed this Oct 28, 2024
@sgsx3 sgsx3 deleted the fix-rousette-resolver branch October 28, 2024 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants