diff --git a/contrib/src/opendht/fetch_and_patch.bat b/contrib/src/opendht/fetch_and_patch.bat
index 1ecdb9e78d8db678c70a016f33f98c912c589ff8..01c7939a1134146dfa9ca6a422b5895146cee8a4 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 48c6ef9b48270c491ee51e5d1cd01f3c13aeb578..b50e96e7ce5763e0e8ab8c381c7fba92bb5aeb8a 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 b11e2611e55ab8fee91e8ce9cf853361b4885f91..40c4d566c97541390a937b488dd7a1b3c7589eed 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);
     }