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(protocols): ProtocolBase.pack() without keywords replaces the instance's header #1769
Describe the bug ProtocolBase.pack() with no keywords rebuilds through make() with defaults, as the #1103 sweep now documents. It also replaces the instance's own header, which leaves the instance disagreeing with itself:
u=UDP(srcport=1234, dstport=53)
u.data# 04d2003500080000u.pack() # 0000000000080000u.schema.srcport# 0 (reserved), while u.info.srcport is still 1234
Expected behavior pack() should not change the parsed or constructed state of the instance it is called on. Afterwards, schema and info should still describe the same packet.
Needs a decision between the two options in the body:
(A) Recommended.pack() with no keywords builds a fresh header but does not assign it, so the instance keeps the state it was parsed or constructed with.
(B) Keep the current behaviour and document the mutation.
A is the smaller contract: calling pack() never changes the packet it is called on. Waiting on your call before any work starts.
Recorded: option A. With no keywords, pack() builds a fresh header and does not assign it to the instance. The instance keeps the state it was parsed or constructed with, so schema and info keep agreeing. A test pins this.
Work starts once the #1103 round-2 slice that is editing protocol.py lands, to avoid a conflict.
Activity
JarryShaw commentedon Oct 15, 2026
Needs a decision between the two options in the body:
pack()with no keywords builds a fresh header but does not assign it, so the instance keeps the state it was parsed or constructed with.A is the smaller contract: calling
pack()never changes the packet it is called on. Waiting on your call before any work starts.JarryShaw commentedon Oct 15, 2026
take A
JarryShaw commentedon Oct 15, 2026
Recorded: option A. With no keywords,
pack()builds a fresh header and does not assign it to the instance. The instance keeps the state it was parsed or constructed with, soschemaandinfokeep agreeing. A test pins this.Work starts once the #1103 round-2 slice that is editing
protocol.pylands, to avoid a conflict.JarryShaw commentedon Oct 15, 2026
Blocked until #1765 and the #1103 round-2 application PR merge. Both edit
pcapkit/protocols/protocol.py. Relabelled frompendingtoblockedto match.JarryShaw commentedon Oct 15, 2026
#1765 has merged. Still blocked, now on #1785 alone (the round-2 application PR, which edits
pcapkit/protocols/protocol.py).JarryShaw commentedon Oct 15, 2026
Unblocked: #1785 has merged. A worker is on option A.
docs(protocols): second whole-repo pass over application, misc and th…