Skip to content

fix(hip): REG_FAILED reads Failure Type as a lifetime and its Reg Types as failure types #2309

Closed

Description

@JarryShaw

Describe the bug
In RFC 8003 §4.5, REG_FAILED carries a Failure Type octet followed by Reg Type octets, and no lifetime. RegFailedParameter names the first octet lifetime, and _read_param_reg_failed reports it as timedelta(seconds=octet). It also decodes the following octets with RegistrationFailure, which is the Failure Type registry, rather than Registration.

Reproduction
HIP(parameters=[(Parameter.REG_FAILED, {'lifetime': 1, 'reg_failed': [1]})], ...) packs 03a8000201010000, which parses back as lifetime=0:00:01, reg_type=(<RegistrationFailure.Registration_type_unavailable: 1>,). Per RFC this is Failure Type 1 (registration type unavailable) for Reg Type 1 (RENDEZVOUS).

Expected behavior
A failure_type: RegistrationFailure and a reg_type: tuple[Registration, ...].

Suggested fix
Rename the schema field and the data attribute, and switch the list's namespace to Registration. The bytes stay unchanged, but the public data model changes, so it needs a ruling.

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

Recommendation: Follow the RFC: replace lifetime with failure_type and keep no alias, in line with the no-re-export ruling for moved names (#1715). Record it as versionchanged on the data class.

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)
    breakingBreaks public-facing behaviour or API (apply alongside the type label)
    designA design or decision issue: a pattern being decided rather than a defect or a request
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    on Oct 26, 2026
  3. moved this to Needs decision in PyPCAPKiton Oct 26, 2026
  4. JarryShaw commented on Oct 26, 2026

    @JarryShaw
    OwnerAuthor

    take recommendations

  5. JarryShaw commented on Oct 26, 2026

    @JarryShaw
    OwnerAuthor

    Ruling noted: taking the recommendation. A fix worker is on it; the PR will reference this issue.

  6. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    on Oct 26, 2026
  7. moved this from Needs decision to WIP in PyPCAPKiton Oct 26, 2026
  8. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 26, 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

    breakingBreaks public-facing behaviour or API (apply alongside the type label)bugIssues reporting a defect (set by the bug report template; a default, not an assessment)designA design or decision issue: a pattern being decided rather than a defect or a request

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions