Article View: linux.debian.bugs.dist
Article #1204Bug#1146596: opendht: diff for NMU version 3.0.1-1.2
From: Adrian Bunk
Date: Sat, 17 Oct 2026 20:20
Date: Sat, 17 Oct 2026 20:20
230 lines
12102 bytes
12102 bytes
--CyS8wcqEx6cQN0MV
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Control: tags 1146596 + pending
Dear maintainer,
I've prepared an NMU for opendht (versioned as 3.0.1-1.2) and uploaded
it to DELAYED/1. Please feel free to tell me if I should cancel it.
cu
Adrian
--CyS8wcqEx6cQN0MV
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment; filename="opendht-3.0.1-1.2-nmu.diff"
Content-Transfer-Encoding: 8bit
diffstat for opendht-3.0.1 opendht-3.0.1
changelog | 8
patches/0001-http-fix-service-name-resolution-failure.patch | 42 ++++
patches/0002-adapt-for-Asio-1.34.patch | 126 ++++++++++++
patches/series | 2
4 files changed, 178 insertions(+)
diff -Nru opendht-3.0.1/debian/changelog opendht-3.0.1/debian/changelog
--- opendht-3.0.1/debian/changelog 2024-02-29 14:15:24.000000000 +0200
+++ opendht-3.0.1/debian/changelog 2026-10-17 22:47:08.000000000 +0300
@@ -1,3 +1,11 @@
+opendht (3.0.1-1.2) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Backport upstream fixes for FTBFS with recent asio.
+ (Closes: #1146596)
+
+ -- Adrian Bunk <bunk@debian.org> Sat, 17 Oct 2026 22:47:08 +0300
+
opendht (3.0.1-1.1) unstable; urgency=medium
* Non-maintainer upload.
diff -Nru opendht-3.0.1/debian/patches/0001-http-fix-service-name-resolution-failure.patch opendht-3.0.1/debian/patches/0001-http-fix-service-name-resolution-failure.patch
--- opendht-3.0.1/debian/patches/0001-http-fix-service-name-resolution-failure.patch 1970-01-01 02:00:00.000000000 +0200
+++ opendht-3.0.1/debian/patches/0001-http-fix-service-name-resolution-failure.patch 2026-10-17 22:47:08.000000000 +0300
@@ -0,0 +1,42 @@
+From 7642674966ecc7f8491b0a39b323d5104a069191 Mon Sep 17 00:00:00 2001
+From: François-Simon Fauteux-Chapleau
+ <francois-simon.fauteux-chapleau@savoirfairelinux.com>
+Date: Mon, 14 Apr 2025 13:25:02 -0400
+Subject: http: fix service name resolution failure
+
+---
+ src/http.cpp | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/src/http.cpp b/src/http.cpp
+index 6b7d4aad..8290268b 100644
+--- a/src/http.cpp
++++ b/src/http.cpp
+@@ -831,10 +831,21 @@ Resolver::add_callback(ResolverCb cb, sa_family_t family)
+ }
+
+ void
+-Resolver::resolve(const std::string& host, const std::string& service)
++Resolver::resolve(const std::string& host, const std::string& serviceName)
+ {
+- asio::ip::tcp::resolver::query query_(host, service);
+- resolver_.async_resolve(query_, [this, host, service, destroyed = destroyed_]
++ auto service = serviceName;
++ // The async_resolve function used below typically relies on the contents of the
++ // /etc/services (Linux/POSIX) or c:\windows\system32\drivers\etc\services (Windows)
++ // file in order to resolve a descriptive service name into a port number. A
++ // resolution attempt that would otherwise succeed can therefore fail if the file
++ // is inaccessible or corrupted (which is rare but can happen in practice). We
++ // hardcode the port numbers for http and https to prevent this failure mode.
++ if (service == "http") {
++ service = "80";
++ } else if (service == "https") {
++ service = "443";
++ }
++ resolver_.async_resolve(host, service, [this, host, service, destroyed = destroyed_]
+ (const asio::error_code& ec, asio::ip::tcp::resolver::results_type endpoints)
+ {
+ if (ec == asio::error::operation_aborted or *destroyed)
+--
+2.47.3
+
diff -Nru opendht-3.0.1/debian/patches/0002-adapt-for-Asio-1.34.patch opendht-3.0.1/debian/patches/0002-adapt-for-Asio-1.34.patch
--- opendht-3.0.1/debian/patches/0002-adapt-for-Asio-1.34.patch 1970-01-01 02:00:00.000000000 +0200
+++ opendht-3.0.1/debian/patches/0002-adapt-for-Asio-1.34.patch 2026-10-17 22:47:08.000000000 +0300
@@ -0,0 +1,126 @@
+From 1fbb12c167b20ab4e297a3b2e76cffa2a6cba7ed Mon Sep 17 00:00:00 2001
+From: Adrien Béraud <>
+Date: Tue, 22 Apr 2025 20:02:37 -0400
+Subject: adapt for Asio 1.34
+
+---
+ src/http.cpp | 20 ++++++++++----------
+ src/peer_discovery.cpp | 6 +++---
+ 2 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/src/http.cpp b/src/http.cpp
+index 8290268b..b0afe65d 100644
+--- a/src/http.cpp
++++ b/src/http.cpp
+@@ -496,7 +496,7 @@ Connection::set_ssl_verification(const std::string& hostname, const asio::ssl::v
+ }
+
+ // starts from CA and goes down the presented chain
+- auto verifier = asio::ssl::rfc2818_verification(hostname);
++ auto verifier = asio::ssl::host_name_verification(hostname);
+ bool verified = verifier(preverified, ctx);
+ auto verify_ec = X509_STORE_CTX_get_error(ctx.native_handle());
+ if (verify_ec != 0 /*X509_V_OK*/ and logger)
+@@ -668,12 +668,12 @@ Connection::async_write(BytesHandlerCb cb)
+ {
+ std::lock_guard<std::mutex> lock(mutex_);
+ if (!is_open()) {
+- if (cb) ctx_.post([cb](){ cb(asio::error::broken_pipe, 0); });
++ if (cb) asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); });
+ return;
+ }
+ if (ssl_socket_) asio::async_write(*ssl_socket_, write_buf_, wrapCallback(std::move(cb)));
+ else if (socket_) asio::async_write(*socket_, write_buf_, wrapCallback(std::move(cb)));
+- else if (cb) ctx_.post([cb](){ cb(asio::error::operation_aborted, 0); });
++ else if (cb) asio::post(ctx_, [cb](){ cb(asio::error::operation_aborted, 0); });
+ }
+
+ void
+@@ -681,12 +681,12 @@ Connection::async_read_until(const char* delim, BytesHandlerCb cb)
+ {
+ std::lock_guard<std::mutex> lock(mutex_);
+ if (!is_open()) {
+- if (cb) ctx_.post([cb](){ cb(asio::error::broken_pipe, 0); });
++ asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); });
+ return;
+ }
+ if (ssl_socket_) asio::async_read_until(*ssl_socket_, read_buf_, delim, wrapCallback(std::move(cb)));
+ else if (socket_) asio::async_read_until(*socket_, read_buf_, delim, wrapCallback(std::move(cb)));
+- else if (cb) ctx_.post([cb](){ cb(asio::error::operation_aborted, 0); });
++ else if (cb) asio::post(ctx_, [cb](){ cb(asio::error::operation_aborted, 0); });
+ }
+
+ void
+@@ -694,12 +694,12 @@ Connection::async_read_until(char delim, BytesHandlerCb cb)
+ {
+ std::lock_guard<std::mutex> lock(mutex_);
+ if (!is_open()) {
+- if (cb) ctx_.post([cb](){ cb(asio::error::broken_pipe, 0); });
++ if (cb) asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); });
+ return;
+ }
+ if (ssl_socket_) asio::async_read_until(*ssl_socket_, read_buf_, delim, wrapCallback(std::move(cb)));
+ else if (socket_) asio::async_read_until(*socket_, read_buf_, delim, wrapCallback(std::move(cb)));
+- else if (cb) ctx_.post([cb](){ cb(asio::error::operation_aborted, 0); });
++ else if (cb) asio::post(ctx_, [cb](){ cb(asio::error::operation_aborted, 0); });
+ }
+
+ void
+@@ -707,12 +707,12 @@ Connection::async_read(size_t bytes, BytesHandlerCb cb)
+ {
+ std::lock_guard<std::mutex> lock(mutex_);
+ if (!is_open()) {
+- if (cb) ctx_.post([cb](){ cb(asio::error::broken_pipe, 0); });
++ if (cb) asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); });
+ return;
+ }
+ if (ssl_socket_) asio::async_read(*ssl_socket_, read_buf_, asio::transfer_exactly(bytes), wrapCallback(std::move(cb)));
+ else if (socket_) asio::async_read(*socket_, read_buf_, asio::transfer_exactly(bytes), wrapCallback(std::move(cb)));
+- else if (cb) ctx_.post([cb](){ cb(asio::error::operation_aborted, 0); });
++ else if (cb) asio::post(ctx_, [cb](){ cb(asio::error::operation_aborted, 0); });
+ }
+
+ void
+@@ -720,7 +720,7 @@ Connection::async_read_some(size_t bytes, BytesHandlerCb cb)
+ {
+ std::lock_guard<std::mutex> lock(mutex_);
+ if (!is_open()) {
+- if (cb) ctx_.post([cb](){ cb(asio::error::broken_pipe, 0); });
++ if (cb) asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); });
+ return;
+ }
+ auto buf = read_buf_.prepare(bytes);
+diff --git a/src/peer_discovery.cpp b/src/peer_discovery.cpp
+index 6fec07ae..0887c8e1 100644
+--- a/src/peer_discovery.cpp
++++ b/src/peer_discovery.cpp
+@@ -83,7 +83,7 @@ PeerDiscovery::DomainPeerDiscovery::DomainPeerDiscovery(asio::ip::udp domain, in
+ : logger_(logger)
+ , ioContext_(ioContext)
+ , sockFd_(*ioContext_, domain)
+- , sockAddrSend_(asio::ip::address::from_string(domain.family() == AF_INET ? MULTICAST_ADDRESS_IPV4
++ , sockAddrSend_(asio::ip::make_address(domain.family() == AF_INET ? MULTICAST_ADDRESS_IPV4
+ : MULTICAST_ADDRESS_IPV6), port)
+ {
+ try {
+@@ -110,7 +110,7 @@ PeerDiscovery::DomainPeerDiscovery::startDiscovery(const std::string &type, Serv
+ callbackmap_[type] = callback;
+ if (not drunning_) {
+ drunning_ = true;
+- ioContext_->post([this] () {
++ asio::post(*ioContext_, [this] () {
+ loopListener();
+ query(sockAddrSend_);
+ });
+@@ -216,7 +216,7 @@ PeerDiscovery::DomainPeerDiscovery::startPublish(const std::string &type, const
+ messages_[type] = std::move(pack_buf_c);
+ reloadMessages();
+ lrunning_ = true;
+- ioContext_->post([this] () { publish(sockAddrSend_); });
++ asio::post(*ioContext_, [this] () { publish(sockAddrSend_); });
+ }
+
+ bool
+--
+2.47.3
+
diff -Nru opendht-3.0.1/debian/patches/series opendht-3.0.1/debian/patches/series
--- opendht-3.0.1/debian/patches/series 2024-01-19 06:19:50.000000000 +0200
+++ opendht-3.0.1/debian/patches/series 2026-10-17 22:47:08.000000000 +0300
@@ -1,3 +1,5 @@
1000-cmake-fix-no-atomic-64.patch
2000-cmake-python-no-build-install.patch
2010-install-dhtnode-http.patch
+0001-http-fix-service-name-resolution-failure.patch
+0002-adapt-for-Asio-1.34.patch
--CyS8wcqEx6cQN0MV--
Technical Details
Message-ID:
<NPj2N-6cnZ-5@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<Nzkcy-eZH6-3@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Adrian Bunk <bunk@debian.org> Newsgroups: linux.debian.bugs.dist Subject: Bug#1146596: opendht: diff for NMU version 3.0.1-1.2 Date: Sat, 17 Oct 2026 22:20:01 +0200 Message-ID: <NPj2N-6cnZ-5@gated-at.bofh.it> References: <Nzkcy-eZH6-3@gated-at.bofh.it> X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Sat Oct 17 20:11:09 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.7 Reply-To: Adrian Bunk <bunk@debian.org>, 1146596@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: bandali@debian.org X-Debian-Pr-Message: followup 1146596 X-Debian-Pr-Package: src:opendht X-Debian-Pr-Keywords: forky ftbfs patch sid X-Debian-Pr-Source: opendht MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="CyS8wcqEx6cQN0MV" Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Debian-User: bunk X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1997299 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 230 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Sat, 17 Oct 2026 23:09:43 +0300 X-Original-Message-ID: <atPWBwwl6EOYBe3w@localhost> X-Original-References: <apm56fBxdPsKmNWN@hecuba.gnuservers.com.ar>