]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/selection*: more precise flags.TCP
authorVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 23 Mar 2021 10:16:01 +0000 (11:16 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 26 Mar 2021 14:44:25 +0000 (15:44 +0100)
I'm overall unsure here, but this does seem as improvement.

lib/rplan.h
lib/selection_forward.c

index 90ccae78204baf9248aa5bf9637a76dc71e26cb4..a0f8f55226a8e025ba27ae72eb0ddacc1a5ff8ed 100644 (file)
@@ -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. */
index 6fa3d743a9bddf8ce3870370222398ad547d4d84..da17bcf3cf4a93080a28c866077a0e2e9a1d0099 100644 (file)
@@ -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;
        }
 }