Repository navigation
fix(toolkit): the pypcapfile engine warns that it leaves TCP over IPv6 out (#1513) - #1535
Conversation
|
Verdict: NEEDS CHANGES at Confirmed:
Needs changing:
|
471e395 to
3989f9e
Compare
|
Verdict: GOOD TO GO at
Non-blocking: the memory is FIFO, so strict round-robin over 33 or more captures warns once per frame. It is never silent. The default engine's own Fragment-header inconsistency is filed separately. |
|
Coverage: 90.03% (unit tier, Python 3.14,
Per-file detail: the |
|
Resolve conflicts |
3989f9e to
d60a162
Compare
|
Verdict: GOOD TO GO at
Not blocking:
|
|
resolve conflicts |
|
On it. #1531 merged, so the worker is rebasing onto |
…6 out (#1513) pypcapfile 0.12.0 has no IPv6 decoder: Ethernet.payload_type maps only 0x0800, so an IPv6 frame's payload stays hex-encoded and _network() returns None. tcp_reassembly and tcp_traceflow dropped those frames without a word. - Both adapters now warn (AttributeWarning) on the first frame of a capture that carries TCP over IPv6, directly or behind the extension headers the default engine steps over (RFC 8200's less ESP, plus Mobility, HIP and Shim6), once per capture rather than per frame. - Captures are keyed by the address of their savefile header, each pinned by an anchor; the last 32 warned about are remembered. - The toolkit, engine docstring and engines docs page state the loss; VLAN, QinQ and tunnelled frames stay out of reach, without a warning. - test_engine_agreement_runtime: the Gap(1513) row is gone. Where the engine warns, its tcp/trace inputs and TCP datagrams are compared with default's over IPv4 only, and its flows skip. Closes #1513
d60a162 to
da66f15
Compare
|
Verdict: GOOD TO GO at
Pre-existing, not blocking: VLAN, QinQ and IPv6-in-IPv6 TCP are still under-reported, as the docstring says (#1537). |
…skips later fragments and padding (#1537, #1576, #1577) pcapfile 0.12.0's Ethernet.payload_type decodes EtherType 0x0800 only, and _transport() read the IPv4 payload to the end of the frame whatever its fragment offset, so the engine's TCP disagreed with the default engine's. - _network() reads past 802.1Q and 802.1ad tags, stacked to any depth, and decodes the IPv4 behind them with pcapfile's own IP decoder (#1537). - TCP over IPv6 behind tags gets #1535's warn-once; TCP tunnelled in IP (4in4, 6in4, 6in6, 4in6) gets a warn-once of its own rather than being read through, as the default engine keys such a flow by the outer header's addresses (#1537). - A later IPv4 fragment is never read as a TCP header (#1576). - The TCP segment ends at the IPv4 Total Length, so Ethernet padding is no longer payload; 0 (TSO) keeps the rest of the frame (#1577). - Docs: the engines table and the toolkit note. Closes #1537 Closes #1576 Closes #1577
…skips later fragments and padding (#1537, #1576, #1577) pcapfile 0.12.0's Ethernet.payload_type decodes EtherType 0x0800 only, and _transport() read the IPv4 payload to the end of the frame whatever its fragment offset, so the engine's TCP disagreed with the default engine's. - _network() reads past 802.1Q and 802.1ad tags, stacked to any depth, and decodes the IPv4 behind them with pcapfile's own IP decoder; one that will not decode warns as an untagged one does, once per frame (#1537). - TCP over IPv6 behind tags gets #1535's warn-once; TCP tunnelled in IP (4in4, 6in4, 6in6, 4in6) gets one of its own rather than being read through, as the default engine keys such a flow by the outer addresses. Either fires only where the default engine's own dissection of the rebuilt frame finds the TCP (#1537). - A later IPv4 fragment is never read as a TCP header (#1576). - The TCP segment ends at the IPv4 Total Length, so Ethernet padding is no longer payload; 0 (TSO) keeps the rest of the frame (#1577). - Docs: the engines table and the toolkit note. Closes #1537 Closes #1576 Closes #1577
…skips later fragments and padding (#1537, #1576, #1577) pcapfile 0.12.0's Ethernet.payload_type decodes EtherType 0x0800 only, and _transport() read the IPv4 payload to the end of the frame whatever its fragment offset, so the engine's TCP disagreed with the default engine's. - _network() reads past 802.1Q and 802.1ad tags, stacked to any depth, and decodes the IPv4 behind them with pcapfile's own IP decoder; one that will not decode warns as an untagged one does, once per frame (#1537). - TCP over IPv6 behind tags gets #1535's warn-once; TCP tunnelled in IP (4in4, 6in4, 6in6, 4in6) gets one of its own rather than being read through, as the default engine keys such a flow by the outer addresses. Both follow the default engine's rules off the raw headers: IP lengths, Jumbo Payload, later fragments, a Data Offset of at least 5 words, and in a tunnel a TCP header that fits; malformed options are not seen into (#1537). - A later IPv4 fragment is never read as a TCP header (#1576). - The TCP segment ends at the IPv4 Total Length, so Ethernet padding is no longer payload; 0 (TSO) keeps the rest of the frame (#1577). - Docs: the engines table and the toolkit note. Closes #1537 Closes #1576 Closes #1577
…1721) Third-party engines are best effort (#1687), so the pypcapfile code that exists only to match the default engine comes out: - revert #1682, #1600, #1575 and #1535, and the pypcapfile hunks of #1655, #1608 and #1605: reading loopback and raw-IP link types, the frame layer bound, the VLAN and tunnel walks, keying tunnelled TCP by the innermost header, stepping over AH and extension headers, and checking options with the default engine's parsers - keep the helpers the dpkt and scapy adapters import, unchanged, until their own reverts drop them; their docstrings no longer say pypcapfile asks the default engine's parsers too - re-land #1576, #1577, #1590 and #1591 as guards in _network and _transport, #1513's once-per-capture warning for TCP straight over IPv6, and #1667's packet2dict fix: an undecoded frame is reported as its octets, not as hex text twice as long - keep #1569's record reader and #1690's packet2timestamp - delete the three test modules those reverts added, the pypcapfile timestamp agreement class, and #1682's link-type warning test; the re-landed guards' tests assert constants - drop what the reverts removed from the docs, READ_LINKTYPES included, and say that TCP behind a VLAN tag, in a tunnel or behind an extension header (an IPv6 one, or AH in IPv4) is now left out without a warning The pypcapfile modules, test_new_engine_parity_runtime.py, test_engine_runtime.py, the timestamp module and the project guards pass on 3.11 (pypcapfile 0.12.0) and 3.14.
Please follow the guide below
make pylint,make mypy,make isort)make testpasses, and a test case covers the change. Targeted selections only; see below.What is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
pypcapfile 0.12.0 has no IPv6 decoder (
Ethernet.payload_typemaps only0x0800), so TCP over IPv6 cannot be handled. Instead,tcp_reassemblyandtcp_traceflownow raise anAttributeWarningonce per capture, on the first frame carrying TCP over IPv6. That covers TCP directly and TCP behind the headers the default engine steps over: RFC 8200's (except ESP), plus Mobility, HIP and Shim6. A first fragment is read as if unfragmented and a later one never counts, as the default engine does since #1539 and #1545. Detection matches default on all 1,495 sample frames and on 10,000 fuzzed chains, with 0 mismatches. Captures are keyed by their savefile header's address, and the last 32 warned about are remembered.Boundary: VLAN-tagged, QinQ and tunnelled frames are not looked into, for IPv6 and IPv4 alike, so TCP inside them is still left out without a warning.
Gap(1513)is gone. Where pypcapfile warns, itstcp/traceinputs and TCPdatagramsare compared with default's over IPv4 only, andflowsskip. The engine docstring and the engines docs page now say so.3 passed, 621 skipped, 621 subtests passed;test_pypcapfile_unit.py35 passed;tests/foundation/engines130 passed, 627 skipped.tests/foundation/engines124 passed, 840 skipped;tests/toolkit127 passed, 10 skipped.origin/main's toolkit, which issues no warning.Closes #1513