Skip to content

fix(reassembly)!: move TCP's gap cap into config as PCAPKIT_TCP_GAP_LIMIT (#2546) - #2579

Merged
JarryShaw merged 1 commit into
mainfrom
fix/2546-tcp-gap-limit
Nov 1, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/2546-tcp-gap-limit

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else
  • const — regenerates constant or registry tables, members keeping their numeric values

Description of your pull request and other information

Closes #2546, per the owner's option 2: TCP's gap cap is a safety limit, not a reassembly rule.

…IMIT (#2546)

- Add config.TCP_GAP_LIMIT, read from PCAPKIT_TCP_GAP_LIMIT, default 16 MiB;
  -1 lifts it, so a segment always merges, bounded only by the sequence space.
- TCP.reassembly reads it at call time; TCP.__window__ is removed with no
  alias (versionremoved:: 1.6.0), and its split description moves to the
  reassembly docstring.
- Document the variable on the config page, and record on
  reassembly-integration.rst that the cap is a safety limit, not a reassembly
  rule.
- Tests: a gap up to a patched limit merges, past it splits (with and without
  a SYN), and -1 merges a gap past the default; drop the stale 1 << 24 entry
  from the RFC-constants sweep.
@JarryShaw JarryShaw added fix Pull requests that fix a defect (fix: subject prefix) breaking Breaks public-facing behaviour or API (apply alongside the type label) review: good-to-go Cross-review at the current head says ready; CI state is separate labels Nov 1, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review (Sonnet) at ee2c5a08d: GOOD TO GO.

  • Limit pattern: TCP_GAP_LIMIT follows the existing pattern: read_limit, minimum 0, a risk string, and -1 uncapped, read at call time. The 16 MiB default is unchanged.
  • Moved name: __window__ shipped in v1.5.0 and v1.5.1, so its removal carries versionremoved and the breaking label.
  • Tests: they fail without the fix on behaviour, not only on the missing name. A cap of 100 with a gap of 101 still merged on main.
  • Non-blocking: the reader tests live in the TCP round-trip module rather than ReaderTests, and the above-default warning text is the same for every value.

@JarryShaw JarryShaw moved this to In review in PyPCAPKit Nov 1, 2026
@JarryShaw
JarryShaw merged commit cf06e9d into main Nov 1, 2026
61 of 62 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Nov 1, 2026
@JarryShaw
JarryShaw deleted the fix/2546-tcp-gap-limit branch November 1, 2026 16:15
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Nov 1, 2026
JarryShaw added a commit that referenced this pull request Nov 1, 2026
- Added: one's-complement checksum verification and computation (#2543),
  and the IPX and SCTP registration wrappers (#2521).
- Folded into unreleased entries: LinuxSLL/FRAD/Netlink registries (#2527),
  the IGMP class names (#2542), TLS record chaining and the SSLv2 trial's
  warnings (#2537), DTLS reassembly via Extractor and toolkit (#2528), and
  IP_Pseudo's walk at any depth (#2543). ICMP drops its stale checksum line.
- Breaking: make() checksums, DRARP's module (#2540), IPv6 overlapping
  fragments (#2569), TCP_GAP_LIMIT replacing TCP.__window__ (#2579), and
  Extractor/extract's positional dtls (#2528).
- Changed: member order (#2490), conventions (#2542, #2521, #2570), CI -n
  logical (#2572). Fixed: AppType.get (#2568), trial warnings (#2519, #2577).
- CHANGELOG.md regenerated; util/changelog_md.py --check passes.
@github-actions github-actions Bot added this to the PyPCAPKit v1.6 milestone Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaks public-facing behaviour or API (apply alongside the type label) fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(reassembly): TCP's gap cap (TCP.__window__) has no RFC basis and silently splits a stream

1 participant