mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-30 21:44:49 +08:00
a26c2b2425
Check the packet length as well as the captured length. Don't have separate "non-verbose" and "verbose" cases, so we don't duplicate the length checks. Print the right value for some length check errors. Clean up the TLV parsing code - keep parsing until we completely run out of data, but make sure, before we look at the TLV header, that we haven't run past the end of the packet as well as that we haven't run past the end of the captured data. In the OSI checksum routine: Have it take an unsigned length, so we don't have to worry about it being negative. Use ND_TTEST2 to check whether the checksum offset is within the bounds of the packet. If we don't have all the packet data to checksum, just report "unverified", don't return a "truncated" error.
36 lines
2.2 KiB
Plaintext
36 lines
2.2 KiB
Plaintext
IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto GRE (47), length 54)
|
|
253.120.2.55 > 192.168.1.1: GREv0, Flags [none], length 34
|
|
IS-IS, length 30
|
|
L1 LSP, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (6), max-area: 7 (7)
|
|
lsp-id: ffff.ffff.ffff.ff-ff, seq: 0xffffffff, lifetime: 65535s
|
|
chksum: 0xffff (incorrect should be 0x0fe8), PDU length: 65535, Flags: [ L1 IS ]
|
|
IS Neighbor(s) (variable length) TLV #7, length: 0 [|isis]
|
|
IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto GRE (47), length 54)
|
|
234.176.145.73 > 192.168.1.1: GREv0, Flags [none], length 34
|
|
IS-IS, length 30
|
|
L1 LSP, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (6), max-area: 7 (7)
|
|
lsp-id: ffff.ffff.ffff.ff-ff, seq: 0xffffffff, lifetime: 65535s
|
|
chksum: 0xffff (incorrect should be 0x0fe8), PDU length: 65535, Flags: [ L1 IS ]
|
|
IS Neighbor(s) (variable length) TLV #7, length: 0 [|isis]
|
|
IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto GRE (47), length 54)
|
|
225.91.211.91 > 192.168.1.1: GREv0, Flags [none], length 34
|
|
IS-IS, length 30
|
|
L1 LSP, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (6), max-area: 7 (7)
|
|
lsp-id: ffff.ffff.ffff.ff-ff, seq: 0xffffffff, lifetime: 65535s
|
|
chksum: 0xffff (incorrect should be 0x0fe8), PDU length: 65535, Flags: [ L1 IS ]
|
|
IS Neighbor(s) (variable length) TLV #7, length: 0 [|isis]
|
|
IP (tos 0x0, ttl 128, id 0, offset 0, flags [DF], proto GRE (47), length 54)
|
|
160.196.17.46 > 192.168.1.1: GREv0, Flags [none], length 34
|
|
IS-IS, length 30
|
|
L1 LSP, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (6), max-area: 7 (7)
|
|
lsp-id: ffff.ffff.ffff.ff-ff, seq: 0xffffffff, lifetime: 65535s
|
|
chksum: 0xffff (incorrect should be 0x0fe8), PDU length: 65535, Flags: [ L1 IS ]
|
|
IS Neighbor(s) (variable length) TLV #7, length: 0 [|isis]
|
|
IP (tos 0x0, ttl 128, id 0, offset 0, flags [DF], proto GRE (47), length 54)
|
|
246.181.173.63 > 192.168.1.1: GREv0, Flags [none], length 34
|
|
IS-IS, length 30
|
|
L1 LSP, hlen: 27, v: 1, pdu-v: 1, sys-id-len: 6 (6), max-area: 7 (7)
|
|
lsp-id: ffff.ffff.ffff.ff-ff, seq: 0xffffffff, lifetime: 65535s
|
|
chksum: 0xffff (incorrect should be 0x0fe8), PDU length: 65535, Flags: [ L1 IS ]
|
|
IS Neighbor(s) (variable length) TLV #7, length: 0 [|isis]
|