From 821987fed735633d3eec5b9c2840fbc81ffbf348 Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 24 Jun 2022 15:31:08 -0400 Subject: [PATCH] don't send peer test for unknown address/port --- libi2pd/SSU2Session.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libi2pd/SSU2Session.cpp b/libi2pd/SSU2Session.cpp index d117008b..1deb5763 100644 --- a/libi2pd/SSU2Session.cpp +++ b/libi2pd/SSU2Session.cpp @@ -1970,7 +1970,11 @@ namespace transport size_t SSU2Session::CreatePeerTestBlock (uint8_t * buf, size_t len, uint32_t nonce) { auto localAddress = FindLocalAddress (); - if (!localAddress) return 0; + if (!localAddress || !localAddress->port || localAddress->host.is_unspecified ()) + { + LogPrint (eLogWarning, "SSU2: Can't find local address for peer test"); + return 0; + } // signed data auto ts = i2p::util::GetSecondsSinceEpoch (); uint8_t signedData[96];