Repository navigation
refactor(toolkit): revert pyshark's agreement-only code (#1708) - #1718
Merged
Merged
Conversation
Third-party engines are best effort (#1687), so the pyshark code that exists only to match the default engine comes out: - revert #1686, #1670 and #1642: the second tshark pass that read a frame's octets, the link type read from the capture file, the 64-layer bound, reading past tshark's 802.1Q limit, and keying a source-routed segment by ip.cur_rt - revert #1613's tshark preferences that turned IP reassembly off, with its FileCapture assertion in test_runtime_engines.py and its sentence in the engines index - keep #1613's partial-TCP-header guard and #1605's keying by the IP header that carries the segment - re-land #1671's crash fix: a TCP layer whose IP layer lacks ip.src or ip.dst is not traced, rather than raising AttributeError - delete the three test modules those reverts added and the agreement checks in test_pyshark_unit.py; the #1611 and #1671 checks assert constants The pyshark test modules, test_runtime_engines.py, test_engine_runtime.py and the project guards pass on 3.11 (tshark 4.6.9) and 3.14.
Owner
Author
Contributor
|
Coverage: 89.41% (unit tier, Python 3.15,
Per-file detail: the |
3 of 13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the change. Narrow runs only, listed below.Added a changelog entry under
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?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseDescription of your pull request and other information
Phase 2 of #1708, for pyshark. It removes the pyshark code that exists only to match the default engine.
ip.cur_rtkeying. Also fix(toolkit): pyshark skips partial TCP headers and traces first fragments (#1611, #1612) #1613'sOVERRIDE_PREFS, with its assertion intest_runtime_engines.pyand its sentence in the engines index (docs/source/pcapkit/foundation/engines/index.rst), both back to their pre-fix(toolkit): pyshark skips partial TCP headers and traces first fragments (#1611, #1612) #1613 text.engines/pyshark.pynow matches its pre-fix(toolkit): pyshark skips partial TCP headers and traces first fragments (#1611, #1612) #1613 version, andtoolkit/pyshark.pyits pre-fix(toolkit): pyshark traces TCP behind an IPv4 extension header as the default engine does (#1625) #1642 version, apart from one guard._has_fixed_header(fix(toolkit): one undissectable TCP header aborts a whole pyshark extraction #1611) and fix(toolkit): key tunnelled TCP by the innermost IP header (#1581) #1605's keying by the carrying IP header._has_addresses. A TCP layer whose IP layer has nosrcordstis skipped. Before, it raisedAttributeError.test_pyshark_unit.py, the fix(toolkit): the pyshark engine traces fragmented TCP at the last fragment, not the first #1612 tests andagree()are gone. The fix(toolkit): one undissectable TCP header aborts a whole pyshark extraction #1611 tshark test and the new fix(toolkit): pyshark's fallback ends the extraction when tshark reports no ip.dst, and keys a source-routed segment by the route's last hop #1671 tests assert constants. Removing either guard makes its tests fail.TSharkCrashException(retcode 255), 7 on this branch and 4 onmainover 10 runs of 73 captures each, a different capture each time. The 255 is asyncio's code for a child process already reaped, not tshark's: tshark alone exits 0 in 1460 of 1460 runs.Runs (3.11 with tshark 4.6.9, then 3.14): pyshark modules,
test_runtime_engines.pyandtest_engine_runtime.py: 59 passed and 1 skipped, then 58 passed and 4 skipped.test_tier_guard.pyandtest_docstring_contract.py: 117 passed on both.--collect-onlyovertests/foundation tests/integration tests/toolkitcollects 853 on both. Sphinx: no new warnings.Part of #1708