Skip to content

docs(toolkit): _default_extension_header keeps a header captured short, contrary to its docstring #2695

Closed

Description

@JarryShaw

Found while re-reviewing #2683; identical on main. The toolkit's _default_extension_header(135, bytes.fromhex('11020742d5bd297b')) returns (17, 24) for an 8-octet capture. Its docstring says it answers None when fewer octets were captured than the header needs, and _walk_extension_headers then slices data[24:] to b''. Make the docstring and the code agree. #2526 relies on the header being kept, so the docstring is the likely side to change.

Activity

  1. added this to the PyPCAPKit v1.6 milestone on Nov 2, 2026
  2. added
    docsPull requests that change documentation only (docs: subject prefix)
    on Nov 2, 2026
  3. moved this to Pending in PyPCAPKiton Nov 2, 2026
  4. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    The host load has cleared, so a worker is on it now. Moved to wip.

  5. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 2, 2026
  6. moved this from Pending to WIP in PyPCAPKiton Nov 2, 2026
  7. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    Fixed on main at be8306140. This is a docs-and-test-only push: the syntax tree with docstrings stripped is identical to main.

    • _default_extension_header now documents its real contract: it answers None below the parser's __length_hint__, and from there keeps the header at its declared length, as IPv4 dissection does.
    • _walk_extension_headers' docstring is corrected the same way.
    • A new test cuts MH and IPv6-Route headers at every offset and checks the reader, the walker and IPv4 dissection agree.
  8. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    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

    docsPull requests that change documentation only (docs: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions