Repository navigation
fix(reassembly): bound TCP holes with a platform-independent open bound (#1959) - #1965
Merged
Merged
Conversation
…nd (#1959) - Add `HOLE_OPEN_BOUND` (`2 ** 63 - 1`) to `pcapkit.foundation.reassembly.data.tcp` and use it, and its negation, for the open ends of the hole descriptor list instead of `sys.maxsize`, which is `2 ** 31 - 1` on GraalPy and 32-bit builds and so falls inside the TCP sequence space - Document the constant on `HoleDescriptor` and the TCP reassembly docs page - Pin the existing hole-list tests to the constant, and add regression tests that patch `sys.maxsize` to `2 ** 31 - 1` with sequence numbers above `2 ** 31` Closes #1959
Owner
Author
|
GOOD TO GO at |
Contributor
|
Coverage: 90.07% (unit tier, Python 3.15,
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)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
TCP reassembly used
sys.maxsizeas the open bound of its hole descriptor list. On GraalPy and 32-bit builds that is2**31 - 1, which lies inside TCP's sequence space. So holes went wrong past2**31, and a FIN'd stream was never seen as whole (#1959).pcapkit.foundation.reassembly.data.tcp.HOLE_OPEN_BOUND(2**63 - 1). It stays anint, asHoleDescriptoris typed, and is JSON- and plist-safe in both signs. It equals 64-bitsys.maxsize, so nothing changes where it already worked.sys.maxsizesite inreassembly/tcp.py. It is documented onHoleDescriptorand the TCP reassembly page.sys.maxsizeto2**31 - 1and drive sequence numbers above2**31. They fail without the fix.Closes #1959