mirror of https://github.com/oxen-io/lokinet
Unleak exit mode DNS via unbound DNS trampoline on (macOS)
When we enable/disable exit mode on this restarts the unbound DNS responder with the DNS trampoline (or restores upstream, when disabling) to properly route DNS requests through the tunnel (because libunbound's direct requests don't get tunneled because unbound is inside the network extension).pull/1688/head
parent
0f097450d7
commit
9dd604820f
@ -0,0 +1,22 @@
|
||||
#include "vpn_platform.hpp"
|
||||
#include "context.hpp"
|
||||
|
||||
namespace llarp::apple
|
||||
{
|
||||
VPNPlatform::VPNPlatform(
|
||||
Context& ctx,
|
||||
VPNInterface::packet_write_callback packet_writer,
|
||||
VPNInterface::on_readable_callback on_readable,
|
||||
llarp_route_callbacks route_callbacks,
|
||||
void* callback_context)
|
||||
: m_Context{ctx}
|
||||
, m_RouteManager{ctx, std::move(route_callbacks), callback_context}
|
||||
, m_PacketWriter{std::move(packet_writer)}
|
||||
, m_OnReadable{std::move(on_readable)}
|
||||
{}
|
||||
|
||||
std::shared_ptr<vpn::NetworkInterface> VPNPlatform::ObtainInterface(vpn::InterfaceInfo)
|
||||
{
|
||||
return std::make_shared<VPNInterface>(m_Context, m_PacketWriter, m_OnReadable);
|
||||
}
|
||||
} // namespace llarp::apple
|
Loading…
Reference in New Issue