fix crashes on shutdown (#1433)

pull/1435/head
Jeff 4 years ago committed by GitHub
parent e47b70a82f
commit c81b6049f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -31,7 +31,10 @@ namespace llarp
void
Proxy::Stop()
{}
{
if (m_UnboundResolver)
m_UnboundResolver->Stop();
}
bool
Proxy::Start(const IpAddress& addr, const std::vector<IpAddress>& resolvers)

@ -12,6 +12,12 @@ namespace llarp::dns
SockAddr source;
};
void
UnboundResolver::Stop()
{
Reset();
}
void
UnboundResolver::Reset()
{

@ -41,6 +41,10 @@ namespace llarp::dns
static void
Callback(void* data, int err, ub_result* result);
// stop resolver thread
void
Stop();
// upstream resolver IP can be IPv4 or IPv6
bool
Init();

@ -893,6 +893,8 @@ namespace llarp
bool
TunEndpoint::Stop()
{
if (m_Resolver)
m_Resolver->Stop();
return llarp::service::Endpoint::Stop();
}

@ -90,7 +90,8 @@ namespace llarp
RoutePoker::~RoutePoker()
{
DeleteAllRoutes();
for (const auto& [ip, gateway] : m_PokedRoutes)
net::DelRoute(ip.ToString(), gateway.ToString());
}
std::optional<huint32_t>

Loading…
Cancel
Save