From: Lukáš Ondráček Date: Wed, 8 Jan 2025 23:13:16 +0000 (+0100) Subject: daemon/defer: fix infinite UDP reclassification after TCP request X-Git-Tag: v6.0.10~6^2~7 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fenvironments%2Fdocs-develop-defe-x6j6qe%2Fdeployments%2F5993;p=thirdparty%2Fknot-resolver.git daemon/defer: fix infinite UDP reclassification after TCP request --- diff --git a/daemon/defer.c b/daemon/defer.c index 0e45a2520..bdd96b5e6 100644 --- a/daemon/defer.c +++ b/daemon/defer.c @@ -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