]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-tcp.c
updated print-isakmp.c to do sensible thing with encrypted payload, and
[tcpdump] / print-tcp.c
index ada96b556e805dba122f75f14688fe7c213a0c9f..b34be32d8ac02bda5b387ba2ae0112300ca7aa49 100644 (file)
@@ -1,3 +1,5 @@
+/*     $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.
@@ -23,7 +25,9 @@
 
 #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
@@ -413,9 +417,9 @@ tcp_print(register const u_char *bp, register u_int length,
                         (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
@@ -426,9 +430,9 @@ tcp_print(register const u_char *bp, register u_int length,
                         (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)");
 
                 }
         }
@@ -463,7 +467,8 @@ tcp_print(register const u_char *bp, register u_int length,
                 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))
@@ -723,9 +728,9 @@ tcp_verify_signature(const struct ip *ip, const struct tcphdr *tp,
         u_int16_t savecsum, tlen;
 #ifdef INET6
         struct ip6_hdr *ip6;
-#endif
         u_int32_t len32;
         u_int8_t nxt;
+#endif
 
         tp1 = *tp;