]> 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]>
Sun, 27 Jan 2019 14:46:05 +0000 (15:46 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 27 Jan 2019 14:51:07 +0000 (15:51 +0100)
In the ts_unix_print() function.

This change is a followup to commit 8e9fb1eb02.

util-print.c

index aa6cf87f8c9703fb8a1dfae64bfe2bc990bd6332..a982e86da4deb95ec4ca2e76ec632e1a4a085b1f 100644 (file)
@@ -295,6 +295,11 @@ ts_date_hmsfrac_print(netdissect_options *ndo, int sec, int usec,
 static void
 ts_unix_print(netdissect_options *ndo, int sec, int usec)
 {
+       if ((unsigned)sec & 0x80000000) {
+               ND_PRINT("[Error converting time]");
+               return;
+       }
+
        ND_PRINT("%u", (unsigned)sec);
        ts_frac_print(ndo, usec);
 }