Repository navigation
fix(toolkit): pypcapfile tcp_reassembly sets last one past the segment - #1108
Merged
Merged
Conversation
TCP_Packet.last is the inclusive sequence number of the last payload octet. The pypcapfile adapter set it to seqnum + len(payload), one past the segment; it now uses seqnum + len(payload) - 1, as the scapy, pcap, pcapng and dpkt adapters do. The pypcapfile-gated real-decoder test pinned the old value (1021) and now expects 1020. A new stand-in test runs without pypcapfile installed. Closes #1100
Owner
Author
|
Cross-review verdict on
The real-library test cannot run on Python 3.12 or later, because pypcapfile 0.12.0 imports |
Contributor
|
Coverage: 88.76% (unit tier, Python 3.14,
Per-file detail: the |
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.
make pylint,make mypy,make isort) — ran pylint/mypy/isort directly on the touched files: isort clean; pylint/mypy messages are pre-existing patterns only (lazypcapfileimport, unused ignore at L617)make testpasses, and a test case covers the change — ran only the modules listed belowdocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A, added centrally after the waveWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #1100.
TCP_Packet.lastis inclusive (foundation/reassembly/data/tcp.py);pypcapfile.tcp_reassemblynow setsseqnum + len(payload) - 1, matching the scapy/pcap/pcapng/dpkt adapters. Other fields checked againstpcap.py: unchanged.last=1021, afterlast=1020.tests/toolkit/test_pypcapfile_tcp_last_unit.pystubspcapfile.protocols.transport.tcpinsys.modules:2 passedwith fix,2 failedwith it reverted.test_pypcapfile_unit.py's pypcapfile-gated test pinned the old1021; now1020(skipped here, pypcapfile not installed).test_pypcapfile_unit.py: 19 passed, 9 skipped.test_pcap_unit.py: 4 passed.tests/project: 379 passed, 1 skipped.