]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/selection_iter.c: fix the last stand switch to UDP
authorŠtěpán Balážik <stepan.balazik@nic.cz>
Fri, 12 Mar 2021 12:36:42 +0000 (13:36 +0100)
committerŠtěpán Balážik <stepan.balazik@nic.cz>
Wed, 17 Mar 2021 13:08:00 +0000 (14:08 +0100)
Previously, qry->flags.TCP flag was incorectly set, which led
to incorrect logging and maybe other troubles down the line.

lib/selection_iter.c

index 97feead5604f585283892f16dc2a5d3265aa75bd..32d5a865f67e2dab17f463e6bfd82fa645278be6 100644 (file)
@@ -286,11 +286,12 @@ void iter_choose_transport(struct kr_query *qry, struct kr_transport **transport
                }
 
                if (*transport &&
-                   (*transport)->protocol==KR_TRANSPORT_TCP &&
+                   (*transport)->protocol == KR_TRANSPORT_TCP &&
                    !qry->server_selection.local_state->truncated &&
                    qry->server_selection.local_state->force_udp) {
                        // Last chance on broken TCP.
                        (*transport)->protocol = KR_TRANSPORT_UDP;
+                       qry->flags.TCP = false;
                }
        }