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 #771

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ All notable changes to the project are documented in this file.
- Updated QoS documentation with pictures and more information on VLAN
interface ingress/egress priority handling.

### Fixes
- Fix #751: R2S rousette crash on boot if LAN not connected.
Fixes resolution for numeric address ::1, regardless of being set in /etc/hosts.


[v24.10.1][] - 2024-10-18
-------------------------
Expand Down
18 changes: 18 additions & 0 deletions patches/nghttp2-asio/0001-resolve-numeric-ipv6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/lib/asio_server.cc b/lib/asio_server.cc
index 74c9227..c3d42aa 100644
--- a/lib/asio_server.cc
+++ b/lib/asio_server.cc
@@ -82,8 +82,13 @@ boost::system::error_code server::bind_and_listen(boost::system::error_code &ec,
// Open the acceptor with the option to reuse the address (i.e.
// SO_REUSEADDR).
tcp::resolver resolver(io_service_pool_.get_io_service());
+
tcp::resolver::query query(address, port);
auto it = resolver.resolve(query, ec);
+ if (ec) {
+ tcp::resolver::query query(address, port, boost::asio::ip::resolver_query_base::numeric_host);
+ it = resolver.resolve(query, ec);
+ }
if (ec) {
return ec;
}