From: Victor Julien Date: Wed, 15 Jul 2015 11:58:12 +0000 (+0200) Subject: dns: fix state progress handling X-Git-Tag: suricata-3.0RC1~239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c419f33f441882ba5c080337667db5591df9eb2c;p=thirdparty%2Fsuricata.git dns: fix state progress handling --- 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)