Repository navigation
fix(engines): the pyshark engine skips non-packet PCAP-NG blocks (#1515) - #1531
Conversation
c191631 to
e46b765
Compare
|
Verdict: GOOD TO GO at
Not covered by this PR, and passed to #1527: |
|
Verdict: NEEDS CHANGES at The Python 3.12 job (114063798474) fails one test, That test's fake packet has no |
e46b765 to
1ec6f74
Compare
|
Verdict: GOOD TO GO at The delta from
The Sonnet review of Merge note: this and #1527 conflict only on their adjacent |
|
Coverage: 90.02% (unit tier, Python 3.14,
Per-file detail: the |
|
Resolve conflicts |
|
On it. The worker is rebasing onto |
1ec6f74 to
bec58be
Compare
|
Verdict: NEEDS CHANGES at
To fix: Non-blocking: |
tshark numbers every record it reads. A systemd Journal Export Block, Custom Block or Sysdig Event Block is a frame to it, but not to the default engine, so test.pcapng read as 6 frames instead of 5. Every frame after the journal block was also off by one. - read_frame skips a record unless its frame layer carries frame.encap_type. Wireshark adds that field for packet records only, in 4.2.2 and 4.6.9. - The frame layer is looked up by name, because frame_info is pkt_comment on a packet that carries a comment. The verbose handler read protocols from frame_info and raised AttributeError on such a packet; it now reads the frame layer too. - Frames are numbered by count, as the default engine numbers them, not by tshark's frame number. - Drop the Gap(1515) rows from the engine agreement module, and pin the engine's traced frame count to [1, 2] in the toolkit tests. Closes #1515
bec58be to
28c9d96
Compare
|
Verdict: GOOD TO GO at
|
make pylint,make mypy,make isort)make testpasses, and a test case covers the change (only the selections below were run, not the whole suite)docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible: N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
tshark numbers every record it reads. A PCAP-NG systemd Journal Export Block, Custom Block or Sysdig Event Block is a frame to tshark 4.6.9, but not to the default engine.
read_framenow skips a record unless itsframelayer carriesframe.encap_type. Wireshark adds that field for packet records only, in 4.2.2 and 4.6.9 (epan/dissectors/packet-frame.c). The layer is found by name, because pyshark'sframe_infoispkt_commenton a packet that carries a comment. The verbose handler readframe_info.protocols, soextract(fin='test.pcapng', engine='pyshark', verbose=True)raisedAttributeErroron frame 1. It now reads the frame layer too. Frames are numbered by count, not by tshark's number.Gap(1515)rows are deleted.test.pcapng/pyshark/*passes on Python 3.11 + tshark 4.6.9; without the fix it fails with6 frames != 5.tests/foundation/engines/test_pyshark_non_packet_unit.py: all 4 tests fail without the fix.test_runtime_engines.pyandtest_extraction_record_header_unit.py: their fake packets now carryframe_infoandlayers, which pyshark 0.6'sPacketalways sets.test_runtime_engines.pyexpects frame 1 rather than tshark's7.tests/foundation,tests/toolkit,tests/integration,tests/project, everytests/test_*.py.Closes #1515