Skip to content

fix(ipv6-route): a truncated RPL address list is split by the octets read, not by Hdr Ext Len #1457

Closed

Description

@JarryShaw

Bug. When an RPL routing header is cut short, its address list is split by the number of octets actually read rather than by Hdr Ext Len (pcapkit/protocols/schema/internet/ipv6_route.py:280-305). Depending on where the cut falls, the parse raises a non-library exception, or info rebuilds with the wrong Hdr Ext Len.

Repro on main (b14d676c5):

rt = bytes([59, 2, 3, 1, 0, 0, 0, 0]) + bytes(range(1, 17))   # uncompressed, one address
IPv6_Route(rt[:23], 23)   # builtins.ValueError: ... does not appear to be an IPv4 or IPv6 address
IPv6_Route(rt[:12], 12)   # ProtocolError: IPv6-Route: [TypeNo 3] invalid format

The worker also reports that with CmprI=CmprE=8 and a cut at 12 octets, the header rebuilds with Hdr Ext Len 1 instead of 2.

Found by #1454 (#1202).

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/1456-1457-rpl-routing.

  4. JarryShaw commented on Oct 9, 2026

    @JarryShaw
    OwnerAuthor

    Correction to the second repro above: IPv6_Route(rt[:12], 12) parses. It is the rebuild, IPv6_Route.from_data(r.info), that raises ProtocolError: IPv6-Route: [TypeNo 3] invalid format. I re-checked this on main, and the first repro (rt[:23] raising a builtins ValueError at parse) stands.

  5. 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