summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-08-09 22:05:05 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-08-10 23:22:21 +0200
commit1d881d77dfba3bc0040c5862caf3cf3a1d143639 (patch)
tree99b911ba0f7cf893fa94fd3ac74d7464542385a0
parentc6ca8a71712729501550714205ab9649b42422aa (diff)
downloadtcpdump-1d881d77dfba3bc0040c5862caf3cf3a1d143639.tar.gz
Report 32-bit timestamps with uppermost bit set as "Error converting time"
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.
-rw-r--r--tests/ip6_frag_asan.out2
-rw-r--r--tests/isis_stlv_asan-2.out2
-rw-r--r--tests/isis_stlv_asan-3.out2
-rw-r--r--tests/isis_stlv_asan-4.out2
-rw-r--r--tests/isis_stlv_asan.out2
-rw-r--r--tests/isis_sysid_asan.out2
-rw-r--r--tests/olsr-oobr-1.out4
-rw-r--r--tests/tok2str-oobr-2.out2
-rw-r--r--tests/vqp-oobr.out2
-rw-r--r--util-print.c5
10 files changed, 15 insertions, 10 deletions
diff --git a/tests/ip6_frag_asan.out b/tests/ip6_frag_asan.out
index 2d8625ce..42f6c963 100644
--- a/tests/ip6_frag_asan.out
+++ b/tests/ip6_frag_asan.out
@@ -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]
diff --git a/tests/isis_stlv_asan-2.out b/tests/isis_stlv_asan-2.out
index 772a4621..fa613196 100644
--- a/tests/isis_stlv_asan-2.out
+++ b/tests/isis_stlv_asan-2.out
@@ -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
diff --git a/tests/isis_stlv_asan-3.out b/tests/isis_stlv_asan-3.out
index 4994566e..f7e3f55b 100644
--- a/tests/isis_stlv_asan-3.out
+++ b/tests/isis_stlv_asan-3.out
@@ -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
diff --git a/tests/isis_stlv_asan-4.out b/tests/isis_stlv_asan-4.out
index 63f6144b..727df938 100644
--- a/tests/isis_stlv_asan-4.out
+++ b/tests/isis_stlv_asan-4.out
@@ -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
diff --git a/tests/isis_stlv_asan.out b/tests/isis_stlv_asan.out
index 4631a4c6..e9071328 100644
--- a/tests/isis_stlv_asan.out
+++ b/tests/isis_stlv_asan.out
@@ -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
diff --git a/tests/isis_sysid_asan.out b/tests/isis_sysid_asan.out
index fa224467..7de52afc 100644
--- a/tests/isis_sysid_asan.out
+++ b/tests/isis_sysid_asan.out
@@ -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
diff --git a/tests/olsr-oobr-1.out b/tests/olsr-oobr-1.out
index 5f770109..37e2ed66 100644
--- a/tests/olsr-oobr-1.out
+++ b/tests/olsr-oobr-1.out
@@ -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]
diff --git a/tests/tok2str-oobr-2.out b/tests/tok2str-oobr-2.out
index 6604e724..9c474b06 100644
--- a/tests/tok2str-oobr-2.out
+++ b/tests/tok2str-oobr-2.out
@@ -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
diff --git a/tests/vqp-oobr.out b/tests/vqp-oobr.out
index 3a6739c3..01825153 100644
--- a/tests/vqp-oobr.out
+++ b/tests/vqp-oobr.out
@@ -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]
diff --git a/util-print.c b/util-print.c
index 026f3461..45da51f7 100644
--- a/util-print.c
+++ b/util-print.c
@@ -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