-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --time-t-size option to print the size of time_t in bits #1147
Conversation
ceb3e95
to
3b6ff61
Compare
e0a36cd
to
5c09904
Compare
Test on linux-armv7l with autoconf 2.72. (In libpcap, AC_SYS_LARGEFILE can be remove if AC_SYS_YEAR2038_RECOMMENDED is added.) Tested also with libpcap version 1.10.5 and tcpdump version 4.99.5 (same patch): 0 tests failed $ ./tcpdump --version |
Test on linux-mips with autoconf 2.72. $ apt list libc6-dev 2.28 < 2.34, minimal version to support the preprocessor macro _TIME_BITS (to have support with -D_TIME_BITS=64). |
For reference, MC includes a lot in the
|
Have tests/TESTrun run "./tcpdump --time-t-size and set HAVE_TIME_T_64 key based on that. This will permit to run tests based on time_t size (32-bit or 64-bit).
da7d8f4
to
78ee203
Compare
Each capture file contains one packet. time_2038.pcap: 2038-01-01 00:00:00 time_2038_max.pcap: 2038-01-19 03:14:07 time_2038_overflow.pcap: 2038-01-19 03:14:08 time_2039.pcap: 2039-01-01 00:00:00 time_2106.pcap: 2106-01-01 00:00:00 time_2106_max.pcap: 2106-02-07 06:28:15 time_2106_overflow.pcapng: 2106-02-07 06:28:16 time_2107.pcapng: 2107-01-01 00:00:00 The packet time when > 2038-01-19T03:14:07Z cannot be correctly printed if time_t size is 32 bits (overflow). Some tests are run only if HAVE_TIME_T_64 is set. it depends on the output of "./tcpdump --time-t-size" (32 or 64). A 32-bit unsigned time_t goes until 2106-02-07T06:28:15Z. All values above require a pcapng file.
(After this PR more steps are needed for Y2038-safety.) |
The CI issues we've been having stems from some new tests tcpdump has for the upcoming 2038 problem. However, these tests will fail with outdated versions of libpcap that don't support the preprocessor macro `_TIME_BITS` (Documented in the-tcpdump-group/tcpdump#1147) **Tcpdump's fixed the issue when running release-check: the-tcpdump-group/tcpdump@0546e6a. Release-check already runs with check and runs all the tests, but with a more defined process.** Since upstream's just running release-check to encapsulate everything, I think we can just run release-check here to get rid of CI issues. ### Call-outs: N/A ### Testing: CI By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
The CI issues we've been having stems from some new tests tcpdump has for the upcoming 2038 problem. However, these tests will fail with outdated versions of libpcap that don't support the preprocessor macro `_TIME_BITS` (Documented in the-tcpdump-group/tcpdump#1147) **Tcpdump's fixed the issue when running release-check: the-tcpdump-group/tcpdump@0546e6a. Release-check already runs with check and runs all the tests, but with a more defined process.** Since upstream's just running release-check to encapsulate everything, I think we can just run release-check here to get rid of CI issues. ### Call-outs: N/A ### Testing: CI By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
Have tests/TESTrun run "./tcpdump --time-t-size and set HAVE_TIME_T_64
key based on that.
This will permit to run tests based on time_t size (32-bit or 64-bit).
Also:
Add eight time test files with packet dates in 2038, 2039, 2106 and 2107
Each capture file contains one packet.
time_2038.pcap: 2038-01-01 00:00:00
time_2038_max.pcap: 2038-01-19 03:14:07
time_2038_overflow.pcap: 2038-01-19 03:14:08
time_2039.pcap: 2039-01-01 00:00:00
time_2106.pcap: 2106-01-01 00:00:00
time_2106_max.pcap: 2106-02-07 06:28:15
time_2106_overflow.pcapng: 2106-02-07 06:28:16
time_2107.pcapng: 2107-01-01 00:00:00
The packet time when > 2038-01-19T03:14:07Z cannot be correctly printed
if time_t size is 32 bits (overflow).
Some tests are run only if HAVE_TIME_T_64 is set. it depends on the
output of "./tcpdump --time-t-size" (32 or 64).
A 32-bit unsigned time_t goes until 2106-02-07T06:28:15Z.
All values above require a pcapng file.