From 156940cc5bccb81a8a05576cce1c989ddb299e12 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 4 Jan 2019 20:46:48 -0800 Subject: [PATCH] Retry STUN over TCP on UDP failure --- mist/mist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mist/mist.cpp b/mist/mist.cpp index 92e258c..789fc36 100644 --- a/mist/mist.cpp +++ b/mist/mist.cpp @@ -533,8 +533,8 @@ bool CheckWANAccess(PSOCKADDR_IN wanAddr, PSOCKADDR_IN reportedWanAddr, bool* fo } printf("Detecting WAN IP address via STUN..."); - if (!getExternalAddressPortIP4(IPPROTO_UDP, 0, wanAddr)) { - DisplayMessage("Unable to determine your public IP address. Please check your Internet connection."); + if (!getExternalAddressPortIP4(IPPROTO_UDP, 0, wanAddr) && !getExternalAddressPortIP4(IPPROTO_TCP, 0, wanAddr)) { + DisplayMessage("Unable to determine your public IP address. Please check your Internet connection or try again in a few minutes."); return false; } else {