Skip to content

fix(ipv4): make() rejects a TS timestamp dict keyed by address strings #1402

Closed

Description

@JarryShaw

Describe the bug
IPv4.make() rejects a TS option whose timestamp dict is keyed by address strings. _make_opt_ts calls int(ip) on each key at pcapkit/protocols/internet/ipv4.py:1655, and the .items(True) path at :1631 does the same, so a dotted-quad string raises instead of being parsed as an address. IPv4Address keys work.

To Reproduce
IPv4(options=[(OptionNumber.TS, {'timestamp': {'1.2.3.4': timedelta(milliseconds=1)}})], protocol=253) raises ValueError: invalid literal for int() with base 10: '1.2.3.4'. This reproduces on main, and also at #1399's head d04716c37, which leaves it unchanged.

Expected behavior
Address keys are converted with ipaddress.ip_address (rejecting bool, as the other address fields do), so a string key works like an IPv4Address key.

Found by the #1399 cross-review. Blocked until #1399 merges, because both PRs edit _make_opt_ts.

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 8, 2026
  2. JarryShaw commented on Oct 8, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1398 and #1399 have merged. One worker is taking #1402 and #1404 together, because both edit protocols/internet/ipv4.py.

  3. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 8, 2026
  4. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 8, 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