]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-tcp.c
DHCP: Fix a comment about formats for (un)signed longs/shorts data
[tcpdump] / print-tcp.c
index e4c65e563ad4ec50edff52665a94eea11ed69d26..aa75602150526b2f627f94113ec5d194d4b10c0c 100644 (file)
@@ -30,9 +30,7 @@
 __RCSID("$NetBSD: print-tcp.c,v 1.8 2007/07/24 11:53:48 drochner Exp $");
 #endif
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
@@ -427,14 +425,19 @@ tcp_print(netdissect_options *ndo,
                 }
         }
 
-        if (flags & TH_ACK) {
+        if (flags & TH_ACK)
                 ND_PRINT(", ack %u", ack);
-        }
+        else
+                if (ndo->ndo_vflag > 1 && ack != 0)
+                        ND_PRINT(", [ack %u != 0 while ACK flag not set]", ack);
 
         ND_PRINT(", win %u", win);
 
         if (flags & TH_URG)
                 ND_PRINT(", urg %u", urp);
+        else
+                if (ndo->ndo_vflag > 1 && urp != 0)
+                        ND_PRINT(", [urg %u != 0 while URG flag not set]", urp);
         /*
          * Handle any options.
          */
@@ -717,8 +720,11 @@ tcp_print(netdissect_options *ndo,
                 nd_trunc_longjmp(ndo);
         }
         bp += header_len;
-        if ((flags & TH_RST) && ndo->ndo_vflag) {
-                print_tcp_rst_data(ndo, bp, length);
+        if (flags & TH_RST) {
+                if(ndo->ndo_vflag)
+                        print_tcp_rst_data(ndo, bp, length);
+                else
+                        ND_TCHECK_LEN(bp, length);
                 return;
         }