|
|
|
@ -115,10 +115,10 @@ namespace llarp
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<byte_t> data{};
|
|
|
|
|
data.resize(payload.sz);
|
|
|
|
|
std::copy_n(payload.base, data.size(), data.data());
|
|
|
|
|
ObtainSNodeSession(*rid, [data, type](auto session) {
|
|
|
|
|
if (not m_Router->ConnectionToRouterAllowed(*rid))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
ObtainSNodeSession(*rid, [data = payload.copy(), type](auto session) {
|
|
|
|
|
if (session and session->IsReady())
|
|
|
|
|
{
|
|
|
|
|
session->SendPacketToRemote(data, type);
|
|
|
|
@ -140,6 +140,8 @@ namespace llarp
|
|
|
|
|
if (std::holds_alternative<service::Address>(addr))
|
|
|
|
|
return false;
|
|
|
|
|
if (auto* rid = std::get_if<RouterID>(&addr))
|
|
|
|
|
{
|
|
|
|
|
if (m_SNodeKeys.count(PubKey{*rid}) or m_Router->ConnectionToRouterAllowed(*rid))
|
|
|
|
|
{
|
|
|
|
|
ObtainSNodeSession(
|
|
|
|
|
*rid, [hook, routerID = *rid](std::shared_ptr<exit::BaseSession> session) {
|
|
|
|
@ -156,6 +158,12 @@ namespace llarp
|
|
|
|
|
hook(std::nullopt);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// probably a client
|
|
|
|
|
hook(GetBestConvoTagFor(addr));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|