Skip to content

fix(hip): packets whose fixed bits are not as sent are rejected, though RFC 7401 §5.1 says receivers must ignore them #1459

Closed

Description

@JarryShaw

Bug. HIP rejects a packet whose two fixed header bits are not set as the sender should set them, even though RFC 7401 §5.1 says receivers MUST ignore those bits. The rejection happens at pcapkit/protocols/internet/hip.py:569-574.

Repro on main (ca5f6dba1):

raw = bytes([59,4,16,0x20]) + bytes(4) + b'\x11'*16 + b'\x22'*16    # fixed bit clear
HIP(raw, len(raw), extension=True)   # ProtocolError: HIP: invalid format
raw = bytes([59,4,0x90,0x21]) + bytes(4) + b'\x11'*16 + b'\x22'*16  # leading bit set
HIP(raw, len(raw), extension=True)   # ProtocolError: HIP: invalid format

The same header with the bits set correctly (0x10/0x21) parses and rebuilds exactly.

RFC 7401 §5.1: the two fixed bits are reserved for SHIM6 compatibility. They "MUST be set as shown when sending and MUST be ignored when receiving."

Expected. Parse such a packet, keep both bits in info, and have from_data rebuild them byte-exact.

Found by the #1454 cross-review.

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/1459-hip-fixed-bits.

  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