You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ipv4): make() rejects a TS timestamp dict keyed by address strings #1402
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
JarryShaw commentedon Oct 8, 2026
Unblocked: #1398 and #1399 have merged. One worker is taking #1402 and #1404 together, because both edit
protocols/internet/ipv4.py.fix(ipv4,tcp)!: a header length declared past the data zero-fills on …
fix(ipv4,tcp)!: a header length declared past the data zero-fills on …