From 9a85ecd553d213fafaa7c2335e8867b6e073cf70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Tue, 17 Oct 2017 19:12:48 +0200
Subject: [PATCH] contrib: bump OpenDHT to 1.4.0

* fix transaction ID reuse bug
* fix minor issues
* minor performance improvements

Change-Id: I7bc0bfa6d3b0f48a0cec9ab4554d265e415c8a68
Reviewed-by: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
---
 contrib/src/opendht/fetch_and_patch.bat | 2 +-
 contrib/src/opendht/rules.mak           | 2 +-
 src/ringdht/ringaccount.cpp             | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/contrib/src/opendht/fetch_and_patch.bat b/contrib/src/opendht/fetch_and_patch.bat
index 1ecdb9e78d..01c7939a11 100644
--- a/contrib/src/opendht/fetch_and_patch.bat
+++ b/contrib/src/opendht/fetch_and_patch.bat
@@ -1,6 +1,6 @@
 set BUILD=%SRC%..\build
 
-set OPENDHT_VERSION=c40750f6e4b0356881675201bbba2d47511c83de
+set OPENDHT_VERSION=4501217c2131e99ea1748801b07753b09fac6626
 set OPENDHT_URL=https://github.com/savoirfairelinux/opendht/archive/%OPENDHT_VERSION%.tar.gz
 
 mkdir %BUILD%
diff --git a/contrib/src/opendht/rules.mak b/contrib/src/opendht/rules.mak
index 48c6ef9b48..b50e96e7ce 100644
--- a/contrib/src/opendht/rules.mak
+++ b/contrib/src/opendht/rules.mak
@@ -1,5 +1,5 @@
 # OPENDHT
-OPENDHT_VERSION := c40750f6e4b0356881675201bbba2d47511c83de
+OPENDHT_VERSION := 1.4.0.1
 OPENDHT_URL := https://github.com/savoirfairelinux/opendht/archive/$(OPENDHT_VERSION).tar.gz
 
 PKGS += opendht
diff --git a/src/ringdht/ringaccount.cpp b/src/ringdht/ringaccount.cpp
index b11e2611e5..40c4d566c9 100644
--- a/src/ringdht/ringaccount.cpp
+++ b/src/ringdht/ringaccount.cpp
@@ -3283,12 +3283,12 @@ RingAccount::registerDhtAddress(IceTransport& ice)
         // IPv6 (sdp support only one IP, put IPv6 before IPv4 as this last has the priority over IPv6 less NAT'able)
         const auto& addr6 = dht_.getPublicAddress(AF_INET6);
         if (addr6.size())
-            setPublishedAddress(reg_addr(ice, addr6[0].first));
+            setPublishedAddress(reg_addr(ice, *addr6[0].get()));
 
         // IPv4
         const auto& addr4 = dht_.getPublicAddress(AF_INET);
         if (addr4.size())
-            setPublishedAddress(reg_addr(ice, addr4[0].first));
+            setPublishedAddress(reg_addr(ice, *addr4[0].get()));
     } else {
         reg_addr(ice, ip);
     }
-- 
GitLab