Skip to content

fix(arp): hardware-address messages lack the protocol prefix, and a bool gets FieldValueError #2256

Closed

Description

@JarryShaw

Describe the bug
ARP._make_addr_resolve has three problems in its hardware-address messages, raised both on the Ethernet branch and on the generic one:

Reproduction (main 31142a816)

>>> ARP()._make_addr_resolve(True, Hardware.Ethernet)
FieldValueError: ARP: invalid hardware address: must not be a bool, not True -- pass int(True) if the numeric value is what is wanted
>>> ARP()._make_addr_resolve(5, Hardware.Ethernet)
ProtocolError: Invalid MAC address: 5
>>> ARP()._make_addr_resolve('zz', Hardware.Ethernet)
ProtocolError: Invalid MAC address: 'zz'

Expected behavior
ARP: invalid MAC address: must be a str, bytes or bytearray, not 5, and ARP: invalid MAC address: 'zz'.

Decision needed: whether the hardware path keeps its bool check. Recommendation: drop it, as #2232 did. A hardware address converts no int, so the True → 0.0.0.1 problem the guard exists for can't occur there. _make_proto_resolve keeps its check, because its IP branches can.

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)
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    on Oct 26, 2026
  3. JarryShaw commented on Oct 26, 2026

    @JarryShaw
    OwnerAuthor

    Drop it

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

    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