don't send invalid local address in RelayRequest

This commit is contained in:
orignal 2024-10-02 12:45:12 -04:00
parent dc4cd34893
commit 34f1ba5bd9

View File

@ -170,7 +170,12 @@ namespace transport
if (!session || !relayTag) return false;
// find local address to introduce
auto localAddress = session->FindLocalAddress ();
if (!localAddress) return false;
if (!localAddress || localAddress->host.is_unspecified () || !localAddress->port)
{
// can't introduce invalid endpoint
LogPrint (eLogWarning, "SSU2: Can't find local address to introduce");
return false;
}
// create nonce
uint32_t nonce;
RAND_bytes ((uint8_t *)&nonce, 4);