diff --git a/src/app-layer-dns-common.c b/src/app-layer-dns-common.c index 1c3f164518..bccad58638 100644 --- a/src/app-layer-dns-common.c +++ b/src/app-layer-dns-common.c @@ -88,7 +88,7 @@ uint64_t DNSGetTxCnt(void *alstate) { int DNSGetAlstateProgress(void *tx, uint8_t direction) { DNSTransaction *dns_tx = (DNSTransaction *)tx; - return dns_tx->replied; + return dns_tx->replied|dns_tx->reply_lost; } /* value for tx->replied value */ @@ -293,6 +293,9 @@ bad_data: void DNSStoreQueryInState(DNSState *dns_state, const uint8_t *fqdn, const uint16_t fqdn_len, const uint16_t type, const uint16_t class, const uint16_t tx_id) { + if (dns_state->curr != NULL && dns_state->curr->replied == 0) + dns_state->curr->reply_lost = 1; + DNSTransaction *tx = DNSTransactionFindByTxId(dns_state, tx_id); if (tx == NULL) { tx = DNSTransactionAlloc(tx_id); diff --git a/src/app-layer-dns-common.h b/src/app-layer-dns-common.h index 7a7e99d34c..1782188bb1 100644 --- a/src/app-layer-dns-common.h +++ b/src/app-layer-dns-common.h @@ -124,9 +124,10 @@ typedef struct DNSAnswerEntry_ { typedef struct DNSTransaction_ { uint16_t tx_num; /**< internal: id */ uint16_t tx_id; /**< transaction id */ - uint16_t replied; /**< bool indicating request is + uint8_t replied; /**< bool indicating request is replied to. */ - uint16_t no_such_name; /**< server said "no such name" */ + uint8_t reply_lost; + uint8_t no_such_name; /**< server said "no such name" */ TAILQ_HEAD(, DNSQueryEntry_) query_list; /**< list for query/queries */ TAILQ_HEAD(, DNSAnswerEntry_) answer_list; /**< list for answers */