|
|
|
@ -162,10 +162,13 @@ namespace llarp
|
|
|
|
|
if (m_Enabled)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (m_Router->GetConfig()->network.m_EnableRoutePoker)
|
|
|
|
|
{
|
|
|
|
|
m_Enabling = true;
|
|
|
|
|
Update();
|
|
|
|
|
m_Enabling = false;
|
|
|
|
|
m_Enabled = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
systemd_resolved_set_dns(
|
|
|
|
|
m_Router->hiddenServiceContext().GetDefault()->GetIfName(),
|
|
|
|
@ -191,6 +194,9 @@ namespace llarp
|
|
|
|
|
void
|
|
|
|
|
RoutePoker::Up()
|
|
|
|
|
{
|
|
|
|
|
if (not m_Router->GetConfig()->network.m_EnableRoutePoker)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
vpn::IRouteManager& route = m_Router->GetVPNPlatform()->RouteManager();
|
|
|
|
|
|
|
|
|
|
// black hole all routes by default
|
|
|
|
@ -207,6 +213,9 @@ namespace llarp
|
|
|
|
|
void
|
|
|
|
|
RoutePoker::Down()
|
|
|
|
|
{
|
|
|
|
|
if (not m_Router->GetConfig()->network.m_EnableRoutePoker)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// unpoke routes for first hops
|
|
|
|
|
m_Router->ForEachPeer(
|
|
|
|
|
[&](auto session, auto) mutable { DelRoute(session->GetRemoteEndpoint().asIPv4()); },
|
|
|
|
|