dns json v2 (C) - log rrtype in response

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2723
pull/3577/head
Jason Ish 7 years ago committed by Victor Julien
parent b7083bc3a8
commit d03a5be118

@ -861,8 +861,8 @@ static json_t *BuildAnswer(DNSTransaction *tx, uint64_t tx_id, uint64_t flags,
DNSCreateRcodeString(tx->rcode, rcode, sizeof(rcode)); DNSCreateRcodeString(tx->rcode, rcode, sizeof(rcode));
json_object_set_new(js, "rcode", json_string(rcode)); json_object_set_new(js, "rcode", json_string(rcode));
/* Log the query rrname. Mostly useful on error, but still /* Log the query rrname and rrtype. Mostly useful on error, but
* useful. */ * still useful. */
DNSQueryEntry *query = TAILQ_FIRST(&tx->query_list); DNSQueryEntry *query = TAILQ_FIRST(&tx->query_list);
if (query != NULL) { if (query != NULL) {
char *c; char *c;
@ -872,6 +872,9 @@ static json_t *BuildAnswer(DNSTransaction *tx, uint64_t tx_id, uint64_t flags,
json_object_set_new(js, "rrname", json_string(c)); json_object_set_new(js, "rrname", json_string(c));
SCFree(c); SCFree(c);
} }
char rrtype[16] = "";
DNSCreateTypeString(query->type, rrtype, sizeof(rrtype));
json_object_set_new(js, "rrtype", json_string(rrtype));
} }
if (flags & LOG_FORMAT_DETAILED) { if (flags & LOG_FORMAT_DETAILED) {

Loading…
Cancel
Save