From 9d79b265060d8afb9667fab473fef8c0364d09f3 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 22 Apr 2021 19:32:47 -0400 Subject: [PATCH] check if port if specified --- libi2pd/SSU.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libi2pd/SSU.cpp b/libi2pd/SSU.cpp index 7a7400f9..6bdd8661 100644 --- a/libi2pd/SSU.cpp +++ b/libi2pd/SSU.cpp @@ -453,7 +453,7 @@ namespace transport m_Service.post (std::bind (&SSUServer::CreateSessionThroughIntroducer, this, router, address, peerTest)); // always V4 thread else { - if (address->host.is_unspecified ()) return false; + if (address->host.is_unspecified () || !address->port) return false; boost::asio::ip::udp::endpoint remoteEndpoint (address->host, address->port); m_Service.post (std::bind (&SSUServer::CreateDirectSession, this, router, remoteEndpoint, peerTest)); } @@ -802,7 +802,7 @@ namespace transport if (introducer && !requested.count (introducer)) // not requested already { auto address = v4 ? introducer->GetSSUAddress (true) : introducer->GetSSUV6Address (); - if (address && !address->host.is_unspecified ()) + if (address && !address->host.is_unspecified () && address->port) { boost::asio::ip::udp::endpoint ep (address->host, address->port); if (std::find (introducers.begin (), introducers.end (), ep) == introducers.end ()) // not connected yet