From c419f33f441882ba5c080337667db5591df9eb2c Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 15 Jul 2015 13:58:12 +0200 Subject: [PATCH] dns: fix state progress handling --- src/app-layer-dns-common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app-layer-dns-common.c b/src/app-layer-dns-common.c index a11daa1eb0..852353f55b 100644 --- a/src/app-layer-dns-common.c +++ b/src/app-layer-dns-common.c @@ -223,8 +223,8 @@ uint64_t DNSGetTxCnt(void *alstate) int DNSGetAlstateProgress(void *tx, uint8_t direction) { DNSTransaction *dns_tx = (DNSTransaction *)tx; - if (direction == 1) - return dns_tx->replied|dns_tx->reply_lost; + if (direction & STREAM_TOCLIENT) + return (dns_tx->replied|dns_tx->reply_lost) ? 2 : 1; else { /* toserver/query is complete if we have stored a query */ return (TAILQ_FIRST(&dns_tx->query_list) != NULL); @@ -237,7 +237,10 @@ int DNSGetAlstateProgress(void *tx, uint8_t direction) */ int DNSGetAlstateProgressCompletionStatus(uint8_t direction) { - return 1; + if (direction & STREAM_TOCLIENT) + return 2; + else + return 1; } void DNSSetEvent(DNSState *s, uint8_t e) -- 2.47.3