+/* $NetBSD: print-tcp.c,v 1.9 2007/07/26 18:15:12 plunky Exp $ */
+
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.
#ifndef lint
static const char rcsid[] _U_ =
-"@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.127 2007-01-29 09:59:42 hannes Exp $ (LBL)";
+"@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.131 2007-11-09 00:34:25 guy Exp $ (LBL)";
+ #else
+__RCSID("$NetBSD: print-tcp.c,v 1.8 2007/07/24 11:53:48 drochner Exp $");
#endif
#ifdef HAVE_CONFIG_H
(void)printf(", cksum 0x%04x",EXTRACT_16BITS(&tp->th_sum));
if (sum != 0) {
tcp_sum = EXTRACT_16BITS(&tp->th_sum);
- (void)printf(" (incorrect -> 0x%04x),",in_cksum_shouldbe(tcp_sum, sum));
+ (void)printf(" (incorrect -> 0x%04x)",in_cksum_shouldbe(tcp_sum, sum));
} else
- (void)printf(" (correct),");
+ (void)printf(" (correct)");
}
}
#ifdef INET6
(void)printf(", cksum 0x%04x",EXTRACT_16BITS(&tp->th_sum));
if (sum != 0) {
tcp_sum = EXTRACT_16BITS(&tp->th_sum);
- (void)printf(" (incorrect (-> 0x%04x),",in_cksum_shouldbe(tcp_sum, sum));
+ (void)printf(" (incorrect -> 0x%04x)",in_cksum_shouldbe(tcp_sum, sum));
} else
- (void)printf(" (correct),");
+ (void)printf(" (correct)");
}
}
cp = (const u_char *)tp + sizeof(*tp);
printf(", options [");
while (hlen > 0) {
- putchar(ch);
+ if (ch != '\0')
+ putchar(ch);
TCHECK(*cp);
opt = *cp++;
if (ZEROLENOPT(opt))
u_int16_t savecsum, tlen;
#ifdef INET6
struct ip6_hdr *ip6;
-#endif
u_int32_t len32;
u_int8_t nxt;
+#endif
tp1 = *tp;