ensure exit router is known

pull/120/head
Jeff Becker 6 years ago
parent a1887dd884
commit eed62b2d7f
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -40,6 +40,12 @@ namespace llarp
bool
IsReady() const;
const llarp::RouterID
Endpoint() const
{
return m_ExitRouter;
}
protected:
llarp::RouterID m_ExitRouter;
std::function< bool(llarp_buffer_t) > m_WritePacket;
@ -107,4 +113,4 @@ namespace llarp
} // namespace exit
} // namespace llarp
#endif
#endif

@ -37,7 +37,9 @@ namespace llarp
llarp::path::PathRole roles)
{
if(hop == numHops - 1)
{
return llarp_nodedb_get_rc(db, m_ExitRouter, cur);
}
else
return path::Builder::SelectHop(db, prev, cur, hop, roles);
}

@ -434,8 +434,6 @@ namespace llarp
// EndpointLogic()->queue_job({this, handleTickTun});
if(m_Exit)
EnsureRouterIsKnown(m_Exit->Endpoint());
FlushSend();
Endpoint::Tick(now);
}
@ -452,13 +450,10 @@ namespace llarp
pkt.UpdateIPv4PacketOnDst({0}, pkt.dst());
m_Exit->QueueUpstreamTraffic(std::move(pkt),
llarp::routing::ExitPadSize);
return true;
}
else
{
llarp::LogWarn(Name(), " has no endpoint for ", pkt.dst());
return true;
}
return true;
}
if(m_SNodes.at(itr->second))

Loading…
Cancel
Save