Skip to content

Commit

Permalink
Made the 'Mismatched TCP length' error only print in DBG mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Ferrell committed Apr 4, 2013
1 parent 55546f9 commit e197f7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions dns_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ void print_summary(ip_info * ip, transport_info * trns, dns_info * dns,
dns_rr_free(dns->answers);
dns_rr_free(dns->name_servers);
dns_rr_free(dns->additional);
fflush(stdout); fflush(stderr);
fflush(stdout);
fflush(stderr);
}

// Print all resource records in the given section.
Expand Down Expand Up @@ -757,7 +758,7 @@ uint32_t dns_parse(uint32_t pos, struct pcap_pkthdr *header,

SHOW_RAW(
printf("dns\n");
print_packet(header->len, packet, pos, header->len, 2);
print_packet(header->len, packet, pos, header->len, 8);
)
VERBOSE(
printf("DNS id:%d, qr:%d, AA:%d, TC:%d, rcode:%d\n",
Expand Down
7 changes: 5 additions & 2 deletions tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,11 @@ void tcp_expire(config * conf, const struct timeval * now ) {
if (pos != offset + 2 + dns_len) {
// If these don't match up, then there is no point in
// continuing for this session.
fprintf(stderr, "Mismatched TCP lengths: %u, %llu.\n",
pos, (offset + 2 + dns_len));
DBG(
fprintf(stderr, "Mismatched TCP lengths: %u, %llu.\n",
pos, (offset + 2 + dns_len));
fflush(stderr);
)
break;
}
// Move on to the next DNS header in the stream.
Expand Down

0 comments on commit e197f7c

Please sign in to comment.