Skip to content

Commit defe846

Browse files
authored
Merge branch 'the-tcpdump-group:master' into haiku-ci
2 parents 0042115 + b84bd2b commit defe846

34 files changed

+42
-46
lines changed

Diff for: tests/babel_update_oobr.out

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
0x0020: ff7f 80ff 80d6 00c3 0880 34d9 4040 0040 ..........4.@@.@
4646
0x0030: 114a 700a 0016 88 .Jp....
4747
33 1970-01-01 00:02:54.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: .M-oM-^?M-^?@M-^?M-^@M-V M-WM-WM-WM-WM-WM-WM-WM-W 0min ^VM-^H [|kerberos]
48-
34 [Error converting time] IP 10.0.0.1.88 > 0.234.154.210.24073: kerberos v4 be KDC_REQUEST: .M-^?M-^?^AM-^@M-^?M-^@M-V@M-WM-WM-sM-WM-WM-WM-WM-W 880min ^VM-^H [|kerberos]
48+
34 2038-01-01 00:00:00.000000 IP 10.0.0.1.88 > 0.234.154.210.24073: kerberos v4 be KDC_REQUEST: .M-^?M-^?^AM-^@M-^?M-^@M-V@M-WM-WM-sM-WM-WM-WM-WM-W 880min ^VM-^H [|kerberos]
4949
35 1970-01-01 00:00:00.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: ^O^O^O^O^O7M-^@M-^?.d^O^O^O^O^O^O^O^O^O^O^O^O@^VM-^H [|kerberos]
5050
36 1971-01-24 09:18:56.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: ^O^O^O^O.^DM-2M-!^BM-WM-^?M-!^B^O^O^P@M-^?M-^?^O^O^O [|kerberos]
5151
37 1970-01-01 00:34:08.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: ^O^O^O^O.^DM-#M-^?M-^?d^O^O^O^O^O^O^O^O^O^O^O^O@^VM-^H [|kerberos]
@@ -65,10 +65,10 @@
6565
51 1970-01-01 00:34:08.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: ^O^O^O^O.^DM-^@M-^?M-^?M-^?^CM-!^B@^D 0min ^P.^VM-^H [|kerberos]
6666
52 1970-01-01 18:12:16.000000 IP 208.21.42.58.6697 > 110.228.104.254.30952: babel 2 (2056) (invalid)
6767
53 1970-01-01 00:00:07.008320 IP 208.21.2.184.1512 > 10.1.1.99.496: auto-rp candidate-advert Hold 16m16s RP 1.235.99.5 PIMv? [rsvd=0xe8] 4.0.0.31/0 bidir,255.0.0.0/33[rsvd=0x14] [|cisco_autorp]
68-
54 [Error converting time] IP 41.0.0.1.88 > 32.235.154.214.24074: kerberos v4 be KDC_REQUEST: M-h^AM-p.PQM-a^QM-x^CM-P^U^BM-8^J^AM-kc^EM-h^K^B@^D [|kerberos]
68+
54 2038-01-01 00:00:00.000000 IP 41.0.0.1.88 > 32.235.154.214.24074: kerberos v4 be KDC_REQUEST: M-h^AM-p.PQM-a^QM-x^CM-P^U^BM-8^J^AM-kc^EM-h^K^B@^D [|kerberos]
6969
55 1970-01-01 00:00:00.000000 IP 208.21.2.184.1512 > 10.1.1.99.496: auto-rp candidate-advert Hold 16m16s RP 1.235.99.5 PIMv? [rsvd=0xe8] 4.0.100.177/0 bidir,!172.0.176.22/177[rsvd=0xb0] [|cisco_autorp]
7070
56 1970-01-01 00:00:00.000000 IP 208.21.2.184.1512 > 10.1.1.99.496: auto-rp candidate-advert Hold 16m16s RP 1.235.99.5 PIMv? [rsvd=0xe8] 4.0.0.31/0 bidir,255.0.3.0/33[rsvd=0x14] [|cisco_autorp]
71-
57 [Error converting time] IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: ^O^O^O.^O^O^O^O^O^DM-2M-!M-1@ 885min M-,.M-0^Vn [|kerberos]
71+
57 2038-01-01 00:00:00.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: ^O^O^O.^O^O^O^O^O^DM-2M-!M-1@ 885min M-,.M-0^Vn [|kerberos]
7272
58 1970-01-01 00:00:00.000000 IP 208.20.225.184.1512 > 10.1.1.99.496: auto-rp candidate-advert Hold 16m16s RP 1.235.99.5 PIMv? [rsvd=0xe8] 4.0.0.0/0 bidir,0.0.0.0/0 [|cisco_autorp]
7373
59 1970-01-01 00:08:32.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: ^O^O^O^O^O^O^O^O^O^DM-WM-WM-WM-WM-WM-WM-W.@ 680min [|kerberos]
7474
60 1970-01-01 00:02:54.000000 IP 10.0.253.1.88 > 0.234.154.214.24073: kerberos v4 be KDC_REQUEST: .M-^?M-^?^AM-^@M-^?M-^@M-V@M-WM-WM-sM-WM-WM-WM-WM-W 880min ^VM-^H [|kerberos]
@@ -100,7 +100,7 @@
100100
82 1970-01-01 00:00:00.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 le APPL_REQUEST_MUTUAL: (unknown)
101101
83 1970-01-01 00:00:00.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: M-^?M-^?M-^?^?M-^@M-^?M-^@M-V.M-C^HM-^@4M-Y@@@@^QJp^J [|kerberos]
102102
84 1970-01-01 00:02:54.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: .M-oM-^?M-^?@M-^?M-^@M-V M-WM-WM-WM-WM-WM-WM-WM-W 0min ^VM-^H [|kerberos]
103-
85 [Error converting time] IP 10.0.0.1.88 > 0.234.154.210.24073: kerberos v4 be KDC_REQUEST: .M-^?M-^?^AM-^@M-^?M-^@M-V@M-WM-WM-sM-WM-WM-WM-WM-W 880min ^VM-^H [|kerberos]
103+
85 2038-01-01 00:00:00.000000 IP 10.0.0.1.88 > 0.234.154.210.24073: kerberos v4 be KDC_REQUEST: .M-^?M-^?^AM-^@M-^?M-^@M-V@M-WM-WM-sM-WM-WM-WM-WM-W 880min ^VM-^H [|kerberos]
104104
86 1970-01-01 00:00:00.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: ^O^O^O^O^O7M-^@M-^?.d^O^O^O^O^O^O^O^O^O^O^O^O@^VM-^H [|kerberos]
105105
87 1971-01-24 09:18:56.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: ^O^O^O^O.^DM-2M-!^BM-WM-^?M-!^B^O^O^P@M-^?M-^?^O^O^O [|kerberos]
106106
88 1970-01-01 00:34:08.000000 IP 10.0.0.1.88 > 0.234.154.214.24074: kerberos v4 be KDC_REQUEST: ^O^O^O^O.^DM-#M-^?M-^?d^O^O^O^O^O^O^O^O^O^O^O^O@^VM-^H [|kerberos]

Diff for: tests/babel_update_oobr.pcap

0 Bytes
Binary file not shown.

Diff for: tests/frf16_magic_ie-oobr.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1 [Error converting time] FRF.16 Control, Flags [Begin, End, Control], Unknown Message (0x00), length 262144
1+
1 2038-01-01 00:00:00.000000 FRF.16 Control, Flags [Begin, End, Control], Unknown Message (0x00), length 262144
22
IE Magic Number (3), length 3: [IE data length 1 != 4] (invalid) [|mfr]

Diff for: tests/frf16_magic_ie-oobr.pcap

-62 Bytes
Binary file not shown.

Diff for: tests/hncp_dhcpv4data-oobr.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1 [Error converting time] IP [total length 296 > length 65] (invalid) (tos 0x12,ECT(0), ttl 48, id 21323, offset 0, flags [+, DF, rsvd], proto UDP (17), length 296, bad cksum 8e0f (->cd08)!)
1+
1 2038-01-01 00:00:00.000000 IP [total length 296 > length 65] (invalid) (tos 0x12,ECT(0), ttl 48, id 21323, offset 0, flags [+, DF, rsvd], proto UDP (17), length 296, bad cksum 8e0f (->cd08)!)
22
1.2.7.0.1812 > 128.253.0.96.8231: hncp (268)
33
DHCPv4-Data (6)
44
DNS-server (98) (invalid)

Diff for: tests/hncp_dhcpv4data-oobr.pcap

0 Bytes
Binary file not shown.

Diff for: tests/ip6_frag_asan.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
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]
1+
1 2038-01-01 00:00:00.000000 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 for: tests/ip6_frag_asan.pcap

0 Bytes
Binary file not shown.

Diff for: tests/isakmp-ikev1_n_print-oobr.out

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
1 [Error converting time] IP (tos 0x12,ECT(0), ttl 17, id 47119, offset 0, flags [+, DF, rsvd], proto UDP (17), length 296, bad cksum 1ff (->327b)!)
1+
1 2038-01-01 00:00:00.000000 IP (tos 0x12,ECT(0), ttl 17, id 47119, offset 0, flags [+, DF, rsvd], proto UDP (17), length 296, bad cksum 1ff (->327b)!)
22
80.236.128.20.500 > 12.251.0.45.49152: isakmp 2.12 msgid 10101010: child_sa ikev2_auth[V]:
33
(n: doi=0 proto=128 type=#24577) [|#126] (len mismatch: isakmp 4278190080/ip 268)
4-
2 [Error converting time] IP (tos 0x12,ECT(0), ttl 17, id 21263, offset 72, flags [+, DF, rsvd], proto unknown (40), length 296, bad cksum fbff (->9847)!)
4+
2 2038-01-01 00:00:00.000000 IP (tos 0x12,ECT(0), ttl 17, id 21263, offset 72, flags [+, DF, rsvd], proto unknown (40), length 296, bad cksum fbff (->9847)!)
55
80.0.128.20 > 12.251.0.45: ip-proto-40
6-
3 [Error converting time] IP (tos 0x15,ECT(1), ttl 17, id 21263, offset 0, flags [+, DF, rsvd], proto UDP (17), length 296, bad cksum 1ff (->9864)!)
6+
3 2038-01-01 00:00:00.000000 IP (tos 0x15,ECT(1), ttl 17, id 21263, offset 0, flags [+, DF, rsvd], proto UDP (17), length 296, bad cksum 1ff (->9864)!)
77
80.0.128.20.500 > 12.251.0.45.49152: isakmp 2.12 msgid 1010100b: child_sa ikev2_auth[V]:
88
(n: doi=ipsec proto=#16 type=REPLAY-STATUS spi=04 status=( [|isakmp]

Diff for: tests/isakmp-ikev1_n_print-oobr.pcap

0 Bytes
Binary file not shown.

Diff for: tests/isis_stlv_asan-2.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1 [Error converting time] UI 22! IS-IS, length 262139
1+
1 2038-01-01 00:00:00.000000 UI 22! IS-IS, length 262139
22
L2 Lan IIH, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (0), max-area: 224 (224)
33
source-id: fed0.f90f.58af, holding time: 34047s, Flags: [unknown circuit type 0x00]
44
lan-id: 0100.0088.a201.1c, Priority: 65, PDU length: 4096

Diff for: tests/isis_stlv_asan-2.pcap

0 Bytes
Binary file not shown.

Diff for: tests/isis_stlv_asan-3.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1 [Error converting time] UI 22! IS-IS, length 262139
1+
1 2038-01-01 00:00:00.000000 UI 22! IS-IS, length 262139
22
L2 Lan IIH, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (0), max-area: 224 (224)
33
source-id: fed0.f90f.58af, holding time: 34047s, Flags: [unknown circuit type 0x00]
44
lan-id: 0100.0088.a201.1c, Priority: 65, PDU length: 4096

Diff for: tests/isis_stlv_asan-3.pcap

0 Bytes
Binary file not shown.

Diff for: tests/isis_stlv_asan-4.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1 [Error converting time] UI 22! Pad! IS-IS, length 262138
1+
1 2038-01-01 00:00:00.000000 UI 22! Pad! IS-IS, length 262138
22
L2 Lan IIH, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (0), max-area: 224 (224)
33
source-id: fe02.0000.d0f9, holding time: 3928s, Flags: [unknown circuit type 0x00]
44
lan-id: 1000.4101.0000.88, Priority: 127, PDU length: 44959

Diff for: tests/isis_stlv_asan-4.pcap

0 Bytes
Binary file not shown.

Diff for: tests/isis_stlv_asan.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1 [Error converting time] UI 22! IS-IS, length 262139
1+
1 2038-01-01 00:00:00.000000 UI 22! IS-IS, length 262139
22
L2 Lan IIH, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (0), max-area: 224 (224)
33
source-id: fed0.f90f.58af, holding time: 34047s, Flags: [unknown circuit type 0x00]
44
lan-id: 0105.0088.a201.00, Priority: 65, PDU length: 4096

Diff for: tests/isis_stlv_asan.pcap

0 Bytes
Binary file not shown.

Diff for: tests/isis_sysid_asan.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1 [Error converting time] UI 22! IS-IS, length 262139
1+
1 2038-01-01 00:00:00.000000 UI 22! IS-IS, length 262139
22
L2 Lan IIH, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (0), max-area: 224 (224)
33
source-id: fed0.f90f.58af, holding time: 34047s, Flags: [unknown circuit type 0x00]
44
lan-id: 0105.0088.a204.00, Priority: 65, PDU length: 4096

Diff for: tests/isis_sysid_asan.pcap

0 Bytes
Binary file not shown.

Diff for: tests/ldp-ldp_tlv_print-oobr.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1 [Error converting time] IP (tos 0x0, id 4608, offset 0, flags [+, DF, rsvd], proto UDP (17), length 25600, options (EOL), bad cksum 8e (->4023)!)
1+
1 2038-01-01 00:00:00.000000 IP (tos 0x0, id 4608, offset 0, flags [+, DF, rsvd], proto UDP (17), length 25600, options (EOL), bad cksum 8e (->4023)!)
22
24.250.219.0.4098 > 0.0.0.0.646:
33
LDP, Label-Space-ID: 0.0.127.255:796, pdu-length: 514
44
Address Withdraw Message (0x0301), length: 22, Message ID: 0x00001600, Flags: [ignore if unknown]

Diff for: tests/ldp-ldp_tlv_print-oobr.pcap

-7 Bytes
Binary file not shown.

Diff for: tests/olsr-oobr-1.out

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
15.251.128.192.698 > 193.192.186.0.122: OLSRv4, seq 0x0800, length 2056
33
Nameservice Message (0x82), originator 126.198.193.192, ttl 26, hop 145
44
vtime 0.062s, msg-seq 0x0008, length 127 [|olsr]
5-
2 [Error converting time] IP [total length 5373 > length 3058] (invalid) (tos 0x0, ttl 18, id 4111, offset 0, flags [+, DF, rsvd], proto UDP (17), length 5373, bad cksum 8e7f (->975f)!)
5+
2 2038-01-01 00:00:00.000000 IP [total length 5373 > length 3058] (invalid) (tos 0x0, ttl 18, id 4111, offset 0, flags [+, DF, rsvd], proto UDP (17), length 5373, bad cksum 8e7f (->975f)!)
66
16.0.128.192.698 > 193.192.186.0.122: OLSRv4, seq 0x0400, length 512
77
Powerinfo Message (0x80), originator 0.1.0.0, ttl 255, hop 255
88
vtime 0.500s, msg-seq 0x0000, length 9216 (invalid)
99
3 1975-08-02 13:38:25.134349078 IP [total length 5373 > length 3058] (invalid) (tos 0x0, ttl 18, id 4111, offset 0, flags [+, DF, rsvd], proto UDP (17), length 5373, bad cksum 8e7f (->9764)!)
1010
15.251.128.192.698 > 193.192.186.0.122: OLSRv4, seq 0x0800, length 2056
1111
Nameservice Message (0x82), originator 126.198.193.192, ttl 26, hop 145
1212
vtime 0.062s, msg-seq 0x0008, length 100 [|olsr]
13-
4 [Error converting time] IP [total length 5373 > length 3058] (invalid) (tos 0x0, ttl 18, id 4111, offset 0, flags [+, DF, rsvd], proto UDP (17), length 5373, bad cksum 8e7f (->975f)!)
13+
4 2038-01-01 00:00:00.000000 IP [total length 5373 > length 3058] (invalid) (tos 0x0, ttl 18, id 4111, offset 0, flags [+, DF, rsvd], proto UDP (17), length 5373, bad cksum 8e7f (->975f)!)
1414
16.0.128.192.698 > 193.192.186.0.122: OLSRv4, seq 0x0800, length 2056
1515
Nameservice Message (0x82), originator 126.198.193.192, ttl 26, hop 145
1616
vtime 0.062s, msg-seq 0x5c50, length 185 [|olsr]

Diff for: tests/olsr-oobr-1.pcap

0 Bytes
Binary file not shown.

Diff for: tests/ppp_error_hexdump.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1 [Error converting time] unknown PPP protocol (0x7e80): IPCP, Conf-Request (0x01), id 0, length 48
1+
1 2038-01-01 00:00:00.000000 unknown PPP protocol (0x7e80): IPCP, Conf-Request (0x01), id 0, length 48
22
encoded length 45 (=Option(s) length 41)
33
0x0000: 8021 0100 002d
44
unknown Option (0x66), length 4

Diff for: tests/ppp_error_hexdump.pcap

0 Bytes
Binary file not shown.

Diff for: tests/rx_serviceid_oobr.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
1 1973-09-21 06:56:17.131350 IP 250.15.128.19.68 > 249.251.157.8.63246: BOOTP/DHCP, unknown (0x00), length 8085
22
2 [Invalid header: caplen==0, len==0]
3-
3 [Error converting time] IP 0.0.0.0.0 > 0.0.0.0.7004: rx abort (539)
3+
3 2038-01-01 00:00:00.000000 IP 0.0.0.0.0 > 0.0.0.0.7004: rx abort (539)

Diff for: tests/rx_serviceid_oobr.pcap

0 Bytes
Binary file not shown.

Diff for: tests/smb_data_print-segv-nosmb.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
192.168.56.119.49199 > 192.168.56.55.445: Flags [P.], cksum 0x2437 (correct), seq 1:75, ack 88, win 254, length 74
55
3 2016-11-30 15:35:08.641033 IP (tos 0x0, ttl 128, id 377, offset 0, flags [DF], proto TCP (6), length 120)
66
192.168.56.55.445 > 192.168.56.119.49199: Flags [P.], cksum 0xf1fb (incorrect -> 0x1559), seq 88:168, ack 75, win 63028, length 80
7-
4 [Error converting time] IP (tos 0x0, ttl 128, id 633, offset 0, flags [DF], proto TCP (6), length 116)
7+
4 2038-01-01 00:00:00.000000 IP (tos 0x0, ttl 128, id 633, offset 0, flags [DF], proto TCP (6), length 116)
88
192.168.56.119.49199 > 192.168.56.55.445: Flags [P.], cksum 0x2253 (incorrect -> 0x229b), seq 75:151, ack 168, win 253, length 76

Diff for: tests/smb_data_print-segv.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@ data:
9292
[000] FF 00 07 00 FF 00 00 00 08 00 00 FF FF FF FF 00 M-^?^@^G^@M-^?^@^@^@ ^H^@^@M-^?M-^?M-^?M-^?^@
9393
[010] 46 00 53 00 F^@S^@
9494

95-
4 [Error converting time] IP (tos 0x0, ttl 128, id 633, offset 0, flags [DF], proto TCP (6), length 116)
95+
4 2038-01-01 00:00:00.000000 IP (tos 0x0, ttl 128, id 633, offset 0, flags [DF], proto TCP (6), length 116)
9696
192.168.56.119.49199 > 192.168.56.55.445: Flags [P.], cksum 0x2253 (incorrect -> 0x229b), seq 75:151, ack 168, win 253, length 76 SMB-over-TCP packet:(raw data or continuation?)
9797

Diff for: tests/smb_data_print-segv.pcapng

-258 Bytes
Binary file not shown.

Diff for: tests/vqp-oobr.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
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)!)
1+
1 2038-01-01 00:00:00.000000 IP (tos 0x0, ttl 17, id 40207, offset 0, flags [+, DF, rsvd], proto UDP (17), length 46, bad cksum 8f04 (->f897)!)
22
0.0.128.20.1589 > 12.251.167.8.62720:
33
VQPv1, unknown (127) Message, error-code unknown (31), seq 0x80f90000, items 27, length 18 [|vqp]

Diff for: tests/vqp-oobr.pcap

0 Bytes
Binary file not shown.

Diff for: util-print.c

+19-23
Original file line numberDiff line numberDiff line change
@@ -214,25 +214,25 @@ nd_printjnp(netdissect_options *ndo, const u_char *s, u_int n)
214214
* Print the timestamp .FRAC part (Microseconds/nanoseconds)
215215
*/
216216
static void
217-
ts_frac_print(netdissect_options *ndo, long usec)
217+
ts_frac_print(netdissect_options *ndo, const struct timeval *tv)
218218
{
219219
#ifdef HAVE_PCAP_SET_TSTAMP_PRECISION
220220
switch (ndo->ndo_tstamp_precision) {
221221

222222
case PCAP_TSTAMP_PRECISION_MICRO:
223-
ND_PRINT(".%06u", (unsigned)usec);
223+
ND_PRINT(".%06u", (unsigned)tv->tv_usec);
224224
break;
225225

226226
case PCAP_TSTAMP_PRECISION_NANO:
227-
ND_PRINT(".%09u", (unsigned)usec);
227+
ND_PRINT(".%09u", (unsigned)tv->tv_usec);
228228
break;
229229

230230
default:
231231
ND_PRINT(".{unknown}");
232232
break;
233233
}
234234
#else
235-
ND_PRINT(".%06u", (unsigned)usec);
235+
ND_PRINT(".%06u", (unsigned)tv->tv_usec);
236236
#endif
237237
}
238238

@@ -242,23 +242,22 @@ ts_frac_print(netdissect_options *ndo, long usec)
242242
* if date_flag == WITH_DATE print YY:MM:DD before HH:MM:SS.FRAC
243243
*/
244244
static void
245-
ts_date_hmsfrac_print(netdissect_options *ndo, long sec, long usec,
245+
ts_date_hmsfrac_print(netdissect_options *ndo, const struct timeval *tv,
246246
enum date_flag date_flag, enum time_flag time_flag)
247247
{
248-
time_t Time = sec;
249248
struct tm *tm;
250249
char timebuf[32];
251250
const char *timestr;
252251

253-
if ((unsigned)sec & 0x80000000) {
254-
ND_PRINT("[Error converting time]");
252+
if (tv->tv_sec < 0) {
253+
ND_PRINT("[timestamp < 1970-01-01 00:00:00 UTC]");
255254
return;
256255
}
257256

258257
if (time_flag == LOCAL_TIME)
259-
tm = localtime(&Time);
258+
tm = localtime(&tv->tv_sec);
260259
else
261-
tm = gmtime(&Time);
260+
tm = gmtime(&tv->tv_sec);
262261

263262
if (date_flag == WITH_DATE) {
264263
timestr = nd_format_time(timebuf, sizeof(timebuf),
@@ -269,22 +268,22 @@ ts_date_hmsfrac_print(netdissect_options *ndo, long sec, long usec,
269268
}
270269
ND_PRINT("%s", timestr);
271270

272-
ts_frac_print(ndo, usec);
271+
ts_frac_print(ndo, tv);
273272
}
274273

275274
/*
276275
* Print the timestamp - Unix timeval style, as SECS.FRAC.
277276
*/
278277
static void
279-
ts_unix_print(netdissect_options *ndo, long sec, long usec)
278+
ts_unix_print(netdissect_options *ndo, const struct timeval *tv)
280279
{
281-
if ((unsigned)sec & 0x80000000) {
282-
ND_PRINT("[Error converting time]");
280+
if (tv->tv_sec < 0) {
281+
ND_PRINT("[timestamp < 1970-01-01 00:00:00 UTC]");
283282
return;
284283
}
285284

286-
ND_PRINT("%u", (unsigned)sec);
287-
ts_frac_print(ndo, usec);
285+
ND_PRINT("%u", (unsigned)tv->tv_sec);
286+
ts_frac_print(ndo, tv);
288287
}
289288

290289
/*
@@ -302,16 +301,15 @@ ts_print(netdissect_options *ndo,
302301
switch (ndo->ndo_tflag) {
303302

304303
case 0: /* Default */
305-
ts_date_hmsfrac_print(ndo, tvp->tv_sec, tvp->tv_usec,
306-
WITHOUT_DATE, LOCAL_TIME);
304+
ts_date_hmsfrac_print(ndo, tvp, WITHOUT_DATE, LOCAL_TIME);
307305
ND_PRINT(" ");
308306
break;
309307

310308
case 1: /* No time stamp */
311309
break;
312310

313311
case 2: /* Unix timeval style */
314-
ts_unix_print(ndo, tvp->tv_sec, tvp->tv_usec);
312+
ts_unix_print(ndo, tvp);
315313
ND_PRINT(" ");
316314
break;
317315

@@ -342,17 +340,15 @@ ts_print(netdissect_options *ndo,
342340
netdissect_timevalsub(tvp, &tv_ref, &tv_result, nano_prec);
343341

344342
ND_PRINT((negative_offset ? "-" : " "));
345-
ts_date_hmsfrac_print(ndo, tv_result.tv_sec, tv_result.tv_usec,
346-
WITHOUT_DATE, UTC_TIME);
343+
ts_date_hmsfrac_print(ndo, &tv_result, WITHOUT_DATE, UTC_TIME);
347344
ND_PRINT(" ");
348345

349346
if (ndo->ndo_tflag == 3)
350347
tv_ref = *tvp; /* set timestamp for previous packet */
351348
break;
352349

353350
case 4: /* Date + Default */
354-
ts_date_hmsfrac_print(ndo, tvp->tv_sec, tvp->tv_usec,
355-
WITH_DATE, LOCAL_TIME);
351+
ts_date_hmsfrac_print(ndo, tvp, WITH_DATE, LOCAL_TIME);
356352
ND_PRINT(" ");
357353
break;
358354
}

0 commit comments

Comments
 (0)