Skip to content

fix(hip): LOCATOR_SET built with spi= raises unless type=1 is also passed #2276

Closed

Description

@JarryShaw

Describe the bug
In HIP._make_param_locator_set, the inner _make_locator sets len=5 when spi is given but leaves type at its default of 0. locator_value_selector accepts only type == 0, len == 4 or type == 1, len == 5, so the public spi= path raises. type=1 without spi fails the same way. Noted in #679 but never tracked.

Reproduction
HIP(parameters=[(Parameter.LOCATOR_SET, {'locator_set': [{'ip': '2001:db8::1', 'spi': 7}]})], ...):

FieldValueError: invalid locator type or length

Adding 'type': 1 builds 00c1001c0001050000000000000000072001....

Expected behavior
spi= builds a Locator Type 1 (ESP SPI plus IPv6, RFC 8046 §4) without the caller restating the type.

Suggested fix
Derive type from spi when it is not given (1 with spi, else 0). Raise ProtocolError naming both values, ending with !r, when an explicit type contradicts spi.

System information
Linux, CPython 3.14.9, pcapkit 1.5.0b14 at 9d504ead5.

Related: #2296 rewords _make_locator's other rejection message.

Activity

  1. added this to the PyPCAPKit v1.5 milestone on Oct 26, 2026
  2. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    on Oct 26, 2026
  3. moved this to Pending in PyPCAPKiton Oct 26, 2026
  4. JarryShaw commented on Oct 26, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until the #2309 fix PR merges. That PR reworks the HIP REG_* parameters in hip.py, and this fix edits the same file, so it starts from the merged tree.

  5. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 26, 2026
  6. moved this from Pending to Blocked in PyPCAPKiton Oct 26, 2026
  7. added
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 27, 2026
  8. JarryShaw commented on Oct 27, 2026

    @JarryShaw
    OwnerAuthor

    Unblocking — #2309 merged. Open to pick up now.

  9. 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 27, 2026
  10. moved this from Blocked to WIP in PyPCAPKiton Oct 27, 2026
  11. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 27, 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

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions