From: itojun Date: Fri, 19 Oct 2001 09:32:01 +0000 (+0000) Subject: comment about DNS-over-TCP decoding. the packet could be unaligned (DNS X-Git-Tag: tcpdump-3.7.1~56 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/f84175e944d859e53b7c3a8f46c3905d84094d6c?ds=inline comment about DNS-over-TCP decoding. the packet could be unaligned (DNS formatted payload does not start at the top of the packet), and in that case, the decoded result could be garage --- diff --git a/print-tcp.c b/print-tcp.c index 13ab3772..9aabd0dd 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.91 2001-10-08 21:25:23 fenner Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.92 2001-10-19 09:32:01 itojun Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -608,7 +608,10 @@ tcp_print(register const u_char *bp, register u_int length, bxxp_print(bp, length); else if (length > 2 && (sport == NAMESERVER_PORT || dport == NAMESERVER_PORT)) { - /* TCP DNS query has 2byte length at the head */ + /* + * TCP DNS query has 2byte length at the head. + * XXX packet could be unaligned, it can go strange + */ ns_print(bp + 2, length - 2); } else if (sport == MSDP_PORT || dport == MSDP_PORT) { msdp_print(bp, length);