]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/defer: fix infinite UDP reclassification after TCP request docs-develop-defe-x6j6qe/deployments/5993
authorLukáš Ondráček <lukas.ondracek@nic.cz>
Wed, 8 Jan 2025 23:13:16 +0000 (00:13 +0100)
committerLukáš Ondráček <lukas.ondracek@nic.cz>
Wed, 8 Jan 2025 23:13:16 +0000 (00:13 +0100)
daemon/defer.c

index 0e45a2520112c6910ef264abbea76452850dd682..bdd96b5e684d2f356e7d3684f13ac332aad67b13 100644 (file)
@@ -450,15 +450,15 @@ static inline void process_single_deferred(void)
                return;
        }
 
-       int priority = classify((const union kr_sockaddr *)ctx->comm->src_addr, ctx->session->stream);
-       if (priority > queue_ix) {  // priority dropped (got higher value)
-               VERBOSE_LOG("    PUSH to %d\n", priority);
-               push_query(ctx, priority, false);
-               return;
-       }
-
        bool eof = false;
        if (ctx->session->stream) {
+               int priority = classify((const union kr_sockaddr *)ctx->comm->src_addr, ctx->session->stream);
+               if (priority > queue_ix) {  // priority dropped (got higher value)
+                       VERBOSE_LOG("    PUSH to %d\n", priority);
+                       push_query(ctx, priority, false);
+                       return;
+               }
+
                kr_assert(queue_head(sdata->queue) == ctx);
                queue_pop(sdata->queue);
                while ((queue_len(sdata->queue) > 0) && (queue_head(sdata->queue) == NULL)) { // EOF event