Skip to content

fix(ipv6): an extension header parsed with extension=True cannot rebuild from its own info #1446

Closed

Description

@JarryShaw

Bug. An IPv6 extension header that was parsed with extension=True does not rebuild from its own info. The layer's .data holds the rest of the datagram, but .info holds only the header, so from_data(info) returns the header alone.

Repro on main (78991b7d5), examples/captures/ipv6.pcap frame 16:

ex = next(iter(frame[IPv6]._exthdr.values()))   # IPv6_Frag
len(type(ex).from_data(ex.info).data), len(ex.data)  # 8, 442

A hand-built HOPOPT + UDP packet behaves the same way (8 of 20 octets), so this is not specific to Fragment. The parent IPv6 layer still rebuilds exactly.

Found by the capture-driven round-trip test in #1445 (#1202), where it is listed in LAYER_GAPS.

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 9, 2026
  2. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 9, 2026
  3. JarryShaw commented on Oct 9, 2026

    @JarryShaw
    OwnerAuthor

    A worker is on it now, on branch fix/1446-ipv6-ext-header-rebuild.

  4. moved this from Pending to WIP in PyPCAPKiton Oct 9, 2026
  5. added a commit that references this issue on Oct 9, 2026
  6. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 9, 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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions