check if we can send HolePunch to partcular address

This commit is contained in:
orignal 2022-06-21 16:20:39 -04:00
parent 22f9abc2f1
commit dda25d431c
4 changed files with 23 additions and 1 deletions

View file

@ -1344,7 +1344,12 @@ namespace transport
{
auto addr = ep.address ().is_v6 () ? r->GetSSU2V6Address () : r->GetSSU2V4Address ();
if (addr)
SendHolePunch (bufbe32toh (buf + 33), ep, addr->i);
{
if (m_Server.IsSupported (ep.address ()))
SendHolePunch (bufbe32toh (buf + 33), ep, addr->i);
else
code = eSSU2RelayResponseCodeCharlieUnsupportedAddress;
}
else
{
LogPrint (eLogWarning, "SSU2: RelayInfo unknown address");