From: Vladimír Čunát Date: Tue, 23 Mar 2021 10:16:01 +0000 (+0100) Subject: lib/selection*: more precise flags.TCP X-Git-Tag: v5.3.1~3^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eeef49d885b131e00077b2dbb3fe388615846c67;p=thirdparty%2Fknot-resolver.git lib/selection*: more precise flags.TCP I'm overall unsure here, but this does seem as improvement. --- diff --git a/lib/rplan.h b/lib/rplan.h index 90ccae782..a0f8f5522 100644 --- a/lib/rplan.h +++ b/lib/rplan.h @@ -17,7 +17,7 @@ struct kr_qflags { bool NO_MINIMIZE : 1; /**< Don't minimize QNAME. */ bool NO_IPV6 : 1; /**< Disable IPv6 */ bool NO_IPV4 : 1; /**< Disable IPv4 */ - bool TCP : 1; /**< Use TCP for this query. */ + bool TCP : 1; /**< Use TCP (or TLS) for this query. */ bool RESOLVED : 1; /**< Query is resolved. Note that kr_query gets * RESOLVED before following a CNAME chain; see .CNAME. */ bool AWAIT_IPV4 : 1; /**< Query is waiting for A address. */ diff --git a/lib/selection_forward.c b/lib/selection_forward.c index 6fa3d743a..da17bcf3c 100644 --- a/lib/selection_forward.c +++ b/lib/selection_forward.c @@ -91,7 +91,8 @@ void forward_choose_transport(struct kr_query *qry, (*transport)->protocol = KR_TRANSPORT_UDP; /* We need to propagate this to flags since it's used in other * parts of the resolver (e.g. logging and stats). */ - qry->flags.TCP = tcp; + qry->flags.TCP = (*transport)->protocol == KR_TRANSPORT_TCP + || (*transport)->protocol == KR_TRANSPORT_TLS; } }