make packet sending logic not attempt to align back to inbound sessions.

pull/1658/head
Jeff Becker 3 years ago
parent 4994208fbc
commit 97df84994e
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -957,12 +957,35 @@ namespace llarp
else
pkt.UpdateIPv6Address({0}, {0});
}
if (SendToOrQueue(to, pkt.Buffer(), type))
// try sending it on an existing convotag
if (SendToOrQueue(to, pkt.ConstBuffer(), type))
return;
// make sure we are not trying to ensure a path to an inbound session
if (const auto* ptr = std::get_if<service::Address>(&to))
{
MarkIPActive(dst);
// it's an inbound session so let's not build back better
if (not WantsOutboundSession(*ptr))
return;
EnsurePathToService(
*ptr,
[pkt, type, this](auto addr, auto* ctx) {
if (ctx == nullptr)
return;
SendToOrQueue(addr, pkt.ConstBuffer(), type);
},
PathAlignmentTimeout());
return;
}
llarp::LogWarn(Name(), " did not flush packets");
// it's an inbound session or a snode session let's gooooo
EnsurePathTo(
to,
[pkt, type, dst, this](auto maybe) {
if (maybe and SendToOrQueue(*maybe, pkt.ConstBuffer(), type))
{
MarkIPActive(dst);
}
},
PathAlignmentTimeout());
});
}

Loading…
Cancel
Save