DNS: convert info logs to debugs

pull/447/merge
Victor Julien 12 years ago
parent 97f51c1011
commit 2f3f577fb6

@ -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) const uint16_t offset, uint8_t *fqdn, const size_t fqdn_size)
{ {
if (input + input_len < input + offset + 1) { 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; goto insufficient_data;
} }
@ -406,7 +406,7 @@ static uint16_t DNSResponseGetNameByOffset(const uint8_t * const input, const ui
qdata = (const uint8_t *)input + offset; qdata = (const uint8_t *)input + offset;
if (input + input_len < qdata + 1) { if (input + input_len < qdata + 1) {
SCLogInfo("input buffer too small"); SCLogDebug("input buffer too small");
goto insufficient_data; goto insufficient_data;
} }
@ -417,7 +417,7 @@ static uint16_t DNSResponseGetNameByOffset(const uint8_t * const input, const ui
if (length > 0) { if (length > 0) {
if (input + input_len < qdata + length) { 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; goto insufficient_data;
} }
//PrintRawDataFp(stdout, qdata, length); //PrintRawDataFp(stdout, qdata, length);
@ -431,7 +431,7 @@ static uint16_t DNSResponseGetNameByOffset(const uint8_t * const input, const ui
qdata += length; qdata += length;
if (input + input_len < qdata + 1) { 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; goto insufficient_data;
} }
@ -472,13 +472,13 @@ static const uint8_t *SkipDomain(const uint8_t * const input,
sdata += ((*sdata) + 1); sdata += ((*sdata) + 1);
} }
if (input + input_len < 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; goto insufficient_data;
} }
} }
sdata++; sdata++;
if (input + input_len < 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; goto insufficient_data;
} }
return sdata; 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) const uint32_t input_len, const uint8_t *data)
{ {
if (input + input_len < data + 2) { 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)); "total answer_rr %u", num, ntohs(dns_header->answer_rr));
goto insufficient_data; 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)) { if (input + input_len < data + sizeof(DNSAnswerHeader)) {
SCLogInfo("input buffer too small for DNSAnswerHeader"); SCLogDebug("input buffer too small for DNSAnswerHeader");
goto insufficient_data; 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)); SCLogDebug("head->len %u", ntohs(head->len));
if (input + input_len < data + 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; goto insufficient_data;
} }
SCLogDebug("TTL %u", ntohl(head->ttl)); 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)); SCLogDebug("head->len %u", ntohs(head->len));
if (input + input_len < data + 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; goto insufficient_data;
} }
@ -630,7 +630,7 @@ const uint8_t *DNSReponseParse(DNSState *dns_state, const DNSHeader * const dns_
data += sizeof(DNSAnswerHeader); data += sizeof(DNSAnswerHeader);
if (input + input_len < data + 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; goto insufficient_data;
} }
@ -682,7 +682,7 @@ const uint8_t *DNSReponseParse(DNSState *dns_state, const DNSHeader * const dns_
} *tail = (struct Trailer *)tdata; } *tail = (struct Trailer *)tdata;
if (input + input_len < tdata + sizeof(struct Trailer)) { 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; goto insufficient_data;
} }
@ -705,7 +705,7 @@ const uint8_t *DNSReponseParse(DNSState *dns_state, const DNSHeader * const dns_
data += sizeof(DNSAnswerHeader); data += sizeof(DNSAnswerHeader);
if (input + input_len < data + 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; goto insufficient_data;
} }

@ -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) { 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); BUG_ON(1);
#endif
len = dns_state->record_len - dns_state->offset; len = dns_state->record_len - dns_state->offset;
} }

Loading…
Cancel
Save