]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Report 32-bit timestamps with uppermost bit set as "Error converting time"
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 9 Aug 2018 20:05:05 +0000 (22:05 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 10 Aug 2018 21:22:21 +0000 (23:22 +0200)
This is an update to packet header timestamps printing based on
Guy Harris's proposal.

Theses timestamps are outside the 1970-2038 range; This happens on some
fuzzed captures.

This will allow to have the same printing on Windows and UN*X.

Update needed before 2038.

tests/ip6_frag_asan.out
tests/isis_stlv_asan-2.out
tests/isis_stlv_asan-3.out
tests/isis_stlv_asan-4.out
tests/isis_stlv_asan.out
tests/isis_sysid_asan.out
tests/olsr-oobr-1.out
tests/tok2str-oobr-2.out
tests/vqp-oobr.out
util-print.c

index 2d8625cea09c313ab6875d33690fd34cd88c06a7..42f6c963e5ee99e5bb99b1d6e4e8c690f1cd4e0f 100644 (file)
@@ -1 +1 @@
-    1  14:21:12.131862 IP6 (class 0x51, flowlabel 0xb2100, hlim 16, next-header Fragment (44) payload length: 27136) 452:22:19:0:41a:e4ff:10ff:484d > 2243:80:1400:100:19:ffff:ffff:fffb:  [|frag6]
+    1  [Error converting time] IP6 (class 0x51, flowlabel 0xb2100, hlim 16, next-header Fragment (44) payload length: 27136) 452:22:19:0:41a:e4ff:10ff:484d > 2243:80:1400:100:19:ffff:ffff:fffb:  [|frag6]
index 772a46213d9b5eaa7164d3c31b2ed3fb629e15eb..fa6131962d06ad7aeccce6dd6559a75f95e2f0c6 100644 (file)
@@ -1,4 +1,4 @@
-    1  03:46:01.1113988 UI 22! IS-IS, length 262139
+    1  [Error converting time] UI 22! IS-IS, length 262139
        L2 Lan IIH, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (0), max-area: 224 (224)
          source-id: fed0.f90f.58af,  holding time: 34047s, Flags: [unknown circuit type 0x00]
          lan-id:    0100.0088.a201.1c, Priority: 65, PDU length: 4096
index 4994566eb865ba545a381bf0dadf5d2f8ef9e9ae..f7e3f55b93e7f6a9b40aea52c434fbae448244a2 100644 (file)
@@ -1,4 +1,4 @@
-    1  03:46:01.1113988 UI 22! IS-IS, length 262139
+    1  [Error converting time] UI 22! IS-IS, length 262139
        L2 Lan IIH, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (0), max-area: 224 (224)
          source-id: fed0.f90f.58af,  holding time: 34047s, Flags: [unknown circuit type 0x00]
          lan-id:    0100.0088.a201.1c, Priority: 65, PDU length: 4096
index 63f6144b0f22d2e4801437ec8eb2d3123eee6f87..727df93889c8d1de6ed1b6a5e99ce68fbdb082f8 100644 (file)
@@ -1,4 +1,4 @@
-    1  03:46:01.1108356 UI 22! Pad! IS-IS, length 262138
+    1  [Error converting time] UI 22! Pad! IS-IS, length 262138
        L2 Lan IIH, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (0), max-area: 224 (224)
          source-id: fe02.0000.d0f9,  holding time: 3928s, Flags: [unknown circuit type 0x00]
          lan-id:    1000.4101.0000.88, Priority: 127, PDU length: 44959
index 4631a4c61d0cbd605f725415bda44ab087f985f4..e907132894440370b83273d2bbb7cdf7cb715966 100644 (file)
@@ -1,4 +1,4 @@
-    1  03:46:01.1113988 UI 22! IS-IS, length 262139
+    1  [Error converting time] UI 22! IS-IS, length 262139
        L2 Lan IIH, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (0), max-area: 224 (224)
          source-id: fed0.f90f.58af,  holding time: 34047s, Flags: [unknown circuit type 0x00]
          lan-id:    0105.0088.a201.00, Priority: 65, PDU length: 4096
index fa224467f740b2d30f5386d90b98d280f462b305..7de52afc05da56cb5a51ca84034af96c221f9691 100644 (file)
@@ -1,4 +1,4 @@
-    1  21:09:13.1113988 UI 22! IS-IS, length 262139
+    1  [Error converting time] UI 22! IS-IS, length 262139
        L2 Lan IIH, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (0), max-area: 224 (224)
          source-id: fed0.f90f.58af,  holding time: 34047s, Flags: [unknown circuit type 0x00]
          lan-id:    0105.0088.a204.00, Priority: 65, PDU length: 4096
index 5f770109e591fd35b578522e8bd7a8a6b7c3aded..37e2ed66ceff4382d615f29ea6a581d60e95a011 100644 (file)
@@ -2,7 +2,7 @@
     15.251.128.192.698 > 193.192.186.0.122: OLSRv4, seq 0x0800, length 2056
        Nameservice Message (0x82), originator 126.198.193.192, ttl 26, hop 145
          vtime 0.062s, msg-seq 0x0008, length 127 [|olsr]
-    2  19:33:17.135336448 IP truncated-ip - 2315 bytes missing! (tos 0x0, ttl 18, id 4111, offset 0, flags [+, DF, rsvd], proto UDP (17), length 5373, bad cksum 8e7f (->975f)!)
+    2  [Error converting time] IP truncated-ip - 2315 bytes missing! (tos 0x0, ttl 18, id 4111, offset 0, flags [+, DF, rsvd], proto UDP (17), length 5373, bad cksum 8e7f (->975f)!)
     16.0.128.192.698 > 193.192.186.0.122: OLSRv4, seq 0x0400, length 512
        Powerinfo Message (0x80), originator 0.1.0.0, ttl 255, hop 255
          vtime 0.500s, msg-seq 0x0000, length 9216 (invalid)
@@ -10,7 +10,7 @@
     15.251.128.192.698 > 193.192.186.0.122: OLSRv4, seq 0x0800, length 2056
        Nameservice Message (0x82), originator 126.198.193.192, ttl 26, hop 145
          vtime 0.062s, msg-seq 0x0008, length 100 [|olsr]
-    4  18:39:57.1118720 IP truncated-ip - 2315 bytes missing! (tos 0x0, ttl 18, id 4111, offset 0, flags [+, DF, rsvd], proto UDP (17), length 5373, bad cksum 8e7f (->975f)!)
+    4  [Error converting time] IP truncated-ip - 2315 bytes missing! (tos 0x0, ttl 18, id 4111, offset 0, flags [+, DF, rsvd], proto UDP (17), length 5373, bad cksum 8e7f (->975f)!)
     16.0.128.192.698 > 193.192.186.0.122: OLSRv4, seq 0x0800, length 2056
        Nameservice Message (0x82), originator 126.198.193.192, ttl 26, hop 145
          vtime 0.062s, msg-seq 0x5c50, length 185 [|olsr]
index 6604e724a5807debf460124795cf8517820628ad..9c474b06dba5cf5201c495bd90d6e97b90ac9805 100644 (file)
@@ -6,7 +6,7 @@
          Return Code: unknown (65)
          Return Subcode: (0)
          Sender Handle: 0x00000023, Sequence: 1
-         Sender Timestamp: 22:09:35.2173923466 Receiver Timestamp: no timestamp
+         Sender Timestamp: [Error converting time] Receiver Timestamp: no timestamp
          Target FEC Stack TLV (1), length: 24
            Unknown subTLV (17), length: 20
              0x0000:  0000 0001 0000 0001 c0a8 0001 c0a8 0001
index 3a6739c32052090821060f883f2dd8a6e7f063ef..01825153bf4352e7d0ee53e563a388b3ff2f4674 100644 (file)
@@ -1,3 +1,3 @@
-    1  15:14:01.134284051 IP (tos 0x0, ttl 17, id 40207, offset 0, flags [+, DF, rsvd], proto UDP (17), length 46, bad cksum 8f04 (->f897)!)
+    1  [Error converting time] IP (tos 0x0, ttl 17, id 40207, offset 0, flags [+, DF, rsvd], proto UDP (17), length 46, bad cksum 8f04 (->f897)!)
     0.0.128.20.1589 > 12.251.167.8.62720: 
        VQPv1, unknown (127) Message, error-code unknown (31) (31), seq 0x80f90000, items 27, length 18 [|vqp]
index 026f3461d4e37a2ace76d4af2e9932a357991ed7..45da51f7407de79352f7f503c1cd88d8f0c23f92 100644 (file)
@@ -270,6 +270,11 @@ ts_date_hmsfrac_print(netdissect_options *ndo, int sec, int usec,
        struct tm *tm;
        char timestr[32];
 
+       if ((unsigned)sec & 0x80000000) {
+               ND_PRINT("[Error converting time]");
+               return;
+       }
+
        if (time_flag == LOCAL_TIME)
                tm = localtime(&Time);
        else