DNS: better handle TX' with lost replies

pull/418/merge
Victor Julien 12 years ago
parent 0fd9b0c4fa
commit 1c371da46d

@ -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);

@ -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 */

Loading…
Cancel
Save