mirror of https://github.com/oxen-io/lokinet
override ShouldHandlePacket on android to bypass non .snode/.loki dns hooking.
This commit is contained in:
parent
7fe5ffb209
commit
b52cf97e11
|
@ -127,16 +127,11 @@ namespace llarp::dns
|
|||
|
||||
if (m_QueryHandler and m_QueryHandler->ShouldHookDNSMessage(msg))
|
||||
return true;
|
||||
// If this request is going to an upstream resolver then we want to let it through (i.e. don't
|
||||
// handle it), and so want to return false. If we have something else then we want to
|
||||
// intercept it to route it through our caching libunbound server (which then redirects the
|
||||
// request to the lokinet-configured upstream, if not cached).
|
||||
#ifdef ANDROID
|
||||
LogError("android dns ", to);
|
||||
return IsUpstreamResolver(to, from);
|
||||
#else
|
||||
// If this request is going to an upstream resolver then we want to let it through (i.e. don't
|
||||
// handle it), and so want to return false. If we have something else then we want to
|
||||
// intercept it to route it through our caching libunbound server (which then redirects the
|
||||
// request to the lokinet-configured upstream, if not cached).
|
||||
return !IsUpstreamResolver(to, from);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -62,6 +62,14 @@ namespace llarp
|
|||
pkt.ConstBuffer(), net::ExpandV4(from.asIPv4()), net::ExpandV4(to.asIPv4()), 0);
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
bool
|
||||
IsUpstreamResolver(const SockAddr&, const SockAddr&) const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
// DNS on Apple is a bit weird because in order for the NetworkExtension itself to send data
|
||||
// through the tunnel we have to proxy DNS requests through Apple APIs (and so our actual
|
||||
|
|
Loading…
Reference in New Issue