Skip to content

fix(sctp): octets after the last whole chunk make the packet fail to parse #1468

Closed

Description

@JarryShaw

Bug. Any octets left after the last complete SCTP chunk make the whole packet fail to parse, so it has no round trip at all.

Repro on main (94ae9664c):

raw = struct.pack('!HHII', 1, 2, 0, 0) + struct.pack('!BBH', 11, 0, 4)   # COOKIE ACK
SCTP(raw, len(raw))                     # parses; from_data rebuilds exactly
SCTP(raw + b'x', len(raw) + 1)          # ProtocolError: Field chunks has an option that runs past the end of the data

The same error comes back with 3 and with 4 trailing octets.

SCTP has no packet-length field, so these octets cannot be told apart from a chunk that has been cut short. Per the #1458 ruling (record, don't reject), the expected behaviour is that the packet parses, the leftover octets are kept as captured (for example as trailer, like #1431/#1460/#1467 do), and the rebuild is byte-exact.

Found by the #1461 worker.

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. JarryShaw commented on Oct 9, 2026

    @JarryShaw
    OwnerAuthor

    A worker is on it now, on branch fix/1468-sctp-stray-octets.

  3. 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
  4. 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