Skip to content

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

Closed

Description

@JarryShaw

From the 2026-11-01 conventions audit, re-verified on 73add05a3. reassembly-integration.rst, "The Rule" point 4: reassembly follows the RFC's own definition and "adds no timeout, cap or ordering rule the RFC does not call for".

Decision needed: does the cap stay?

  1. Drop it: a segment always merges, bounded only by the sequence space.
  2. Keep it as a limit in config.py (PCAPKIT_*, -1 = no limit, feat(utilities): one config module for the tunable limits (PCAPKIT_* environment variables), and one home per duplicated protocol constant #1726), default unchanged, and note on the page that it is a safety limit, not a reassembly rule.
  3. Keep it as is, and record the exception on reassembly-integration.rst.
    Recommendation: 2, because the wide gap is a memory-amplification risk that config.py already handles this way (PCAPKIT_MAX_ZERO_PAD_LENGTH), and -1 gives point 4 its uncapped mode.
    Fix: on 2: add the variable, read it in TCP.reassembly, update TCP.__window__'s docs, test both sides of the cap and -1. It edits config.py (also edited by feat(protocols)!: verify and compute one's-complement checksums (#2470) #2543) and the page (also edited by refactor(foundation): route DTLS reassembly via toolkit and analysis (#2496) #2528).

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    on Nov 1, 2026
  2. moved this to Needs decision in PyPCAPKiton Nov 1, 2026
  3. JarryShaw commented on Nov 1, 2026

    @JarryShaw
    OwnerAuthor

    Yes, do 2

  4. JarryShaw commented on Nov 1, 2026

    @JarryShaw
    OwnerAuthor

    Owner chose 2, paraphrased: the cap stays as a safety limit, not a reassembly rule.

    • It moves into pcapkit/utilities/config.py as a PCAPKIT_* variable, with -1 meaning no limit and the 16 MiB default unchanged. TCP.reassembly reads it, and TCP.__window__'s docs say so.
    • reassembly-integration.rst records it as a safety limit, outside "The Rule" point 4.
    • Tests cover both sides of the cap and -1.

    A worker is dispatched. Any conflict with #2543's config.py additions or #2528's page edit gets resolved at merge.

  5. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    on Nov 1, 2026
  6. moved this from Needs decision to WIP in PyPCAPKiton Nov 1, 2026
  7. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 1, 2026
  8. added this to the PyPCAPKit v1.6 milestone on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixPull requests that fix a defect (fix: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions