#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.82 2001-01-28 08:06:07 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.84 2001-02-03 05:04:49 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "ip6.h"
#endif
+#include "nameser.h"
+
static void print_tcp_rst_data(register const u_char *sp, u_int length);
#define MAX_RST_DATA_LEN 30
if (!qflag) {
if ((u_char *)tp + 4 + sizeof(struct rpc_msg) <= snapend &&
dport == NFS_PORT) {
- nfsreq_print((u_char *)tp + hlen + 4, length-hlen,
+ nfsreq_print((u_char *)tp + hlen + 4, length - hlen,
(u_char *)ip);
return;
} else if ((u_char *)tp + 4 + sizeof(struct rpc_msg)
memset(&tha, 0, sizeof(tha));
rev = 0;
if (ip6) {
- if (sport > dport) {
+ if (sport > dport)
rev = 1;
- } else if (sport == dport) {
- int i;
-
- for (i = 0; i < 4; i++) {
- if (((u_int32_t *)(&ip6->ip6_src))[i] >
- ((u_int32_t *)(&ip6->ip6_dst))[i]) {
- rev = 1;
- break;
+ else if (sport == dport) {
+ int i;
+
+ for (i = 0; i < 4; i++) {
+ if (((u_int32_t *)(&ip6->ip6_src))[i] >
+ ((u_int32_t *)(&ip6->ip6_dst))[i]) {
+ rev = 1;
+ break;
+ }
}
- }
}
if (rev) {
tha.src = ip6->ip6_dst;
th->ack = seq, th->seq = ack - 1;
else
th->seq = seq, th->ack = ack - 1;
-
} else {
if (rev)
seq -= th->ack, ack -= th->seq;
nbt_tcp_print(bp, length);
else if (sport == BXXP_PORT || dport == BXXP_PORT)
bxxp_print(bp, length);
+ else if (length > 2 &&
+ (sport == NAMESERVER_PORT || dport == NAMESERVER_PORT)) {
+ /* TCP DNS query has 2byte length at the head */
+ ns_print(bp + 2, length - 2);
+ }
}
return;
bad: