tcpdump mailing list archives

print-tcp.c: remove commas from output, to be consistent


From: Kevin Steves <stevesk () pobox com>
Date: Wed, 17 Jan 2007 11:51:28 -0800

commas aren't used in tcp fields so remove these that are
before and after cksum.

Index: print-tcp.c
===================================================================
RCS file: /tcpdump/master/tcpdump/print-tcp.c,v
retrieving revision 1.126
diff -u -r1.126 print-tcp.c
--- print-tcp.c 2 Nov 2006 08:56:16 -0000       1.126
+++ print-tcp.c 17 Jan 2007 19:45:14 -0000
@@ -411,12 +411,12 @@
                if (TTEST2(tp->th_sport, length)) {
                        sum = tcp_cksum(ip, tp, length);
 
-                        (void)printf(", cksum 0x%04x",EXTRACT_16BITS(&tp->th_sum));
+                        (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
@@ -424,12 +424,12 @@
                u_int16_t sum,tcp_sum;
                if (TTEST2(tp->th_sport, length)) {
                        sum = tcp6_cksum(ip6, tp, length);
-                        (void)printf(", cksum 0x%04x",EXTRACT_16BITS(&tp->th_sum));
+                        (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)");
 
                }
        }
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: