From 5c3b4090d2eb13c70394ef786d369074d1e37d51 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 14 Jun 2021 08:17:44 -0400 Subject: [PATCH] dont mark inbound sessions as outbound when we get a DNS lookup for it --- llarp/handlers/tun.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/llarp/handlers/tun.cpp b/llarp/handlers/tun.cpp index 7ab8f1dcb..e6dba331f 100644 --- a/llarp/handlers/tun.cpp +++ b/llarp/handlers/tun.cpp @@ -397,6 +397,13 @@ namespace llarp service::Address addr, auto msg, bool isV6) -> bool { using service::Address; using service::OutboundContext; + if(HasInboundConvo(addr)) + { + // if we have an inbound convo to this address don't mark as outbound so we don't have a state race + // this codepath is hit when an application verifies that reverse and forward dns records match for an inbound session + SendDNSReply(addr, this, msg, reply, isV6); + return true; + } MarkAddressOutbound(addr); return EnsurePathToService( addr, @@ -424,6 +431,7 @@ namespace llarp service::Address addr, auto msg) -> bool { using service::Address; using service::OutboundContext; + // TODO: how do we handle SRV record lookups for inbound sessions? MarkAddressOutbound(addr); return EnsurePathToService( addr,