replied to. */
uint8_t reply_lost;
uint8_t no_such_name; /**< server said "no such name" */
+ uint8_t recursion_desired; /**< server said "recursion desired" */
TAILQ_HEAD(, DNSQueryEntry_) query_list; /**< list for query/queries */
TAILQ_HEAD(, DNSAnswerEntry_) answer_list; /**< list for answers */
}
}
+ /* see if this is a "no such name" error */
+ if (ntohs(dns_header->flags) & 0x0003) {
+ SCLogDebug("no such name");
+ if (tx != NULL)
+ tx->no_such_name = 1;
+ }
+
+ if (ntohs(dns_header->flags) & 0x0080) {
+ SCLogDebug("recursion desired");
+ if (tx != NULL)
+ tx->recursion_desired = 1;
+ }
+
+ if (tx != NULL) {
+ tx->replied = 1;
+ }
+
SCReturnInt(1);
bad_data:
insufficient_data:
/* see if this is a "no such name" error */
if (ntohs(dns_header->flags) & 0x0003) {
SCLogDebug("no such name");
-
- if (tx != NULL) {
+ if (tx != NULL)
tx->no_such_name = 1;
- }
+ }
+
+ if (ntohs(dns_header->flags) & 0x0080) {
+ SCLogDebug("recursion desired");
+ if (tx != NULL)
+ tx->recursion_desired = 1;
+ }
+
+ if (tx != NULL) {
+ tx->replied = 1;
}
SCReturnInt(1);
"%s [**] Response TX %04x [**] ", timebuf, tx->tx_id);
if (entry == NULL) {
- MemBufferWriteString(aft->buffer,
- "No Such Name");
+ if (tx->no_such_name)
+ MemBufferWriteString(aft->buffer, "No Such Name");
+ else if (tx->recursion_desired)
+ MemBufferWriteString(aft->buffer, "Recursion Desired");
} else {
/* query */
if (entry->fqdn_len > 0) {
LogQuery(aft, timebuf, dstip, srcip, dp, sp, tx, query);
}
- if (tx->no_such_name) {
+ if (tx->no_such_name)
+ LogAnswer(aft, timebuf, srcip, dstip, sp, dp, tx, NULL);
+ if (tx->recursion_desired)
LogAnswer(aft, timebuf, srcip, dstip, sp, dp, tx, NULL);
- }
DNSAnswerEntry *entry = NULL;
TAILQ_FOREACH(entry, &tx->answer_list, next) {