diff --git a/llarp/dns/server.cpp b/llarp/dns/server.cpp index deeea0dbe..5c8d6b4ca 100644 --- a/llarp/dns/server.cpp +++ b/llarp/dns/server.cpp @@ -58,7 +58,7 @@ namespace llarp::dns return true; auto failFunc = [self = weak_from_this()]( - const SockAddr& from, const SockAddr& to, Message msg) { + const SockAddr& to, const SockAddr& from, Message msg) { if (auto this_ptr = self.lock()) this_ptr->SendServerMessageBufferTo(to, from, msg.ToBuffer()); }; diff --git a/llarp/dns/unbound_resolver.cpp b/llarp/dns/unbound_resolver.cpp index 90ebbbcd3..422a5c6fd 100644 --- a/llarp/dns/unbound_resolver.cpp +++ b/llarp/dns/unbound_resolver.cpp @@ -58,7 +58,7 @@ namespace llarp::dns { Message& msg = lookup->msg; msg.AddServFail(); - this_ptr->failFunc(lookup->resolverAddr, lookup->askerAddr, msg); + this_ptr->failFunc(lookup->askerAddr, lookup->resolverAddr, msg); ub_resolve_free(result); return; } @@ -73,7 +73,7 @@ namespace llarp::dns buf.cur = buf.base; hdr.Encode(&buf); - this_ptr->replyFunc(lookup->resolverAddr, lookup->askerAddr, std::move(pkt)); + this_ptr->replyFunc(lookup->askerAddr, lookup->resolverAddr, std::move(pkt)); ub_resolve_free(result); } @@ -145,7 +145,7 @@ namespace llarp::dns if (not unboundContext) { msg.AddServFail(); - failFunc(to, from, std::move(msg)); + failFunc(from, to, std::move(msg)); return; } @@ -163,7 +163,7 @@ namespace llarp::dns if (err != 0) { msg.AddServFail(); - failFunc(to, from, std::move(msg)); + failFunc(from, to, std::move(msg)); return; } } diff --git a/llarp/dns/unbound_resolver.hpp b/llarp/dns/unbound_resolver.hpp index e1861ab88..8d6605304 100644 --- a/llarp/dns/unbound_resolver.hpp +++ b/llarp/dns/unbound_resolver.hpp @@ -18,9 +18,9 @@ namespace llarp::dns { using ReplyFunction = - std::function; + std::function; using FailFunction = - std::function; + std::function; class UnboundResolver : public std::enable_shared_from_this {