Remove obsolete/extraneous WouldLoop function

The DNS resolver code should not and can not be responsible for
preventing packet looping.
pull/2076/head
Thomas Winget 2 years ago
parent a518e654c5
commit 133cee0fd9

@ -455,20 +455,6 @@ namespace llarp::dns
Up(m_conf);
}
bool
WouldLoop(const SockAddr& to, const SockAddr& from) const override
{
#if defined(ANDROID)
(void)to;
(void)from;
return false;
#else
const auto& vec = m_conf.m_upstreamDNS;
return std::find(vec.begin(), vec.end(), to) != std::end(vec)
or std::find(vec.begin(), vec.end(), from) != std::end(vec);
#endif
}
template <typename Callable>
void
call(Callable&& f)
@ -486,9 +472,6 @@ namespace llarp::dns
const SockAddr& to,
const SockAddr& from) override
{
if (WouldLoop(to, from))
return false;
auto tmp = std::make_shared<Query>(weak_from_this(), query, source, to, from);
// no questions, send fail
if (query.questions.empty())

@ -197,16 +197,6 @@ namespace llarp::dns
const Message& query,
const SockAddr& to,
const SockAddr& from) = 0;
/// Returns true if a packet with to and from addresses is something that would cause a
/// resolution loop and thus should not be used on this resolver
virtual bool
WouldLoop(const SockAddr& to, const SockAddr& from) const
{
(void)to;
(void)from;
return false;
}
};
// Base class for DNS proxy

Loading…
Cancel
Save