From 2f3f577fb631ae8ec0ba4ffb4f8f5b0ad9be2e5f Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 18 Jul 2013 07:10:07 +0200 Subject: [PATCH] DNS: convert info logs to debugs --- src/app-layer-dns-common.c | 26 +++++++++++++------------- src/app-layer-dns-tcp.c | 4 +++- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/app-layer-dns-common.c b/src/app-layer-dns-common.c index bccad58638..e824d8a8c4 100644 --- a/src/app-layer-dns-common.c +++ b/src/app-layer-dns-common.c @@ -386,7 +386,7 @@ static uint16_t DNSResponseGetNameByOffset(const uint8_t * const input, const ui const uint16_t offset, uint8_t *fqdn, const size_t fqdn_size) { if (input + input_len < input + offset + 1) { - SCLogInfo("input buffer too small for domain of len %u", offset); + SCLogDebug("input buffer too small for domain of len %u", offset); goto insufficient_data; } @@ -406,7 +406,7 @@ static uint16_t DNSResponseGetNameByOffset(const uint8_t * const input, const ui qdata = (const uint8_t *)input + offset; if (input + input_len < qdata + 1) { - SCLogInfo("input buffer too small"); + SCLogDebug("input buffer too small"); goto insufficient_data; } @@ -417,7 +417,7 @@ static uint16_t DNSResponseGetNameByOffset(const uint8_t * const input, const ui if (length > 0) { if (input + input_len < qdata + length) { - SCLogInfo("input buffer too small for domain of len %u", length); + SCLogDebug("input buffer too small for domain of len %u", length); goto insufficient_data; } //PrintRawDataFp(stdout, qdata, length); @@ -431,7 +431,7 @@ static uint16_t DNSResponseGetNameByOffset(const uint8_t * const input, const ui qdata += length; if (input + input_len < qdata + 1) { - SCLogInfo("input buffer too small for len field"); + SCLogDebug("input buffer too small for len field"); goto insufficient_data; } @@ -472,13 +472,13 @@ static const uint8_t *SkipDomain(const uint8_t * const input, sdata += ((*sdata) + 1); } if (input + input_len < sdata) { - SCLogInfo("input buffer too small for data of len"); + SCLogDebug("input buffer too small for data of len"); goto insufficient_data; } } sdata++; if (input + input_len < sdata) { - SCLogInfo("input buffer too small for data of len"); + SCLogDebug("input buffer too small for data of len"); goto insufficient_data; } return sdata; @@ -491,7 +491,7 @@ const uint8_t *DNSReponseParse(DNSState *dns_state, const DNSHeader * const dns_ const uint32_t input_len, const uint8_t *data) { if (input + input_len < data + 2) { - SCLogInfo("input buffer too small for record 'name' field, record %u, " + SCLogDebug("input buffer too small for record 'name' field, record %u, " "total answer_rr %u", num, ntohs(dns_header->answer_rr)); goto insufficient_data; } @@ -533,7 +533,7 @@ const uint8_t *DNSReponseParse(DNSState *dns_state, const DNSHeader * const dns_ } if (input + input_len < data + sizeof(DNSAnswerHeader)) { - SCLogInfo("input buffer too small for DNSAnswerHeader"); + SCLogDebug("input buffer too small for DNSAnswerHeader"); goto insufficient_data; } @@ -548,7 +548,7 @@ const uint8_t *DNSReponseParse(DNSState *dns_state, const DNSHeader * const dns_ SCLogDebug("head->len %u", ntohs(head->len)); if (input + input_len < data + ntohs(head->len)) { - SCLogInfo("input buffer too small for data of len %u", ntohs(head->len)); + SCLogDebug("input buffer too small for data of len %u", ntohs(head->len)); goto insufficient_data; } SCLogDebug("TTL %u", ntohl(head->ttl)); @@ -599,7 +599,7 @@ const uint8_t *DNSReponseParse(DNSState *dns_state, const DNSHeader * const dns_ SCLogDebug("head->len %u", ntohs(head->len)); if (input + input_len < data + ntohs(head->len)) { - SCLogInfo("input buffer too small for data of len %u", ntohs(head->len)); + SCLogDebug("input buffer too small for data of len %u", ntohs(head->len)); goto insufficient_data; } @@ -630,7 +630,7 @@ const uint8_t *DNSReponseParse(DNSState *dns_state, const DNSHeader * const dns_ data += sizeof(DNSAnswerHeader); if (input + input_len < data + ntohs(head->len)) { - SCLogInfo("input buffer too small for data of len %u", ntohs(head->len)); + SCLogDebug("input buffer too small for data of len %u", ntohs(head->len)); goto insufficient_data; } @@ -682,7 +682,7 @@ const uint8_t *DNSReponseParse(DNSState *dns_state, const DNSHeader * const dns_ } *tail = (struct Trailer *)tdata; if (input + input_len < tdata + sizeof(struct Trailer)) { - SCLogInfo("input buffer too small for data of len"); + SCLogDebug("input buffer too small for data of len"); goto insufficient_data; } @@ -705,7 +705,7 @@ const uint8_t *DNSReponseParse(DNSState *dns_state, const DNSHeader * const dns_ data += sizeof(DNSAnswerHeader); if (input + input_len < data + ntohs(head->len)) { - SCLogInfo("input buffer too small for data of len %u", ntohs(head->len)); + SCLogDebug("input buffer too small for data of len %u", ntohs(head->len)); goto insufficient_data; } diff --git a/src/app-layer-dns-tcp.c b/src/app-layer-dns-tcp.c index 109c9e07ab..498479181a 100644 --- a/src/app-layer-dns-tcp.c +++ b/src/app-layer-dns-tcp.c @@ -159,8 +159,10 @@ static int BufferData(DNSState *dns_state, uint8_t *data, uint16_t len) { } if ((uint32_t)len + (uint32_t)dns_state->offset > (uint32_t)dns_state->record_len) { - SCLogInfo("oh my, we have more data than the max record size. What do we do. WHAT DO WE DOOOOO!"); + SCLogDebug("oh my, we have more data than the max record size. What do we do. WHAT DO WE DOOOOO!"); +#ifdef DEBUG BUG_ON(1); +#endif len = dns_state->record_len - dns_state->offset; }