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(tcp): NS flag is written by make() but never parsed #1098
Describe the bug make() packs the NS bit, but the reader has #ns=bool(schema.offset['ns']) commented out (tcp.py:474). data/transport/tcp.py:52 also has #ns commented out, so Flags has no ns field.
Reproduction TCP(srcport=1, dstport=2, ns=True) sets byte 12 to 0x51, so NS is on the wire. The parsed Flags has no ns field, and a from_data rebuild clears NS with no warning.
Expected behavior
NS round-trips. If it was dropped on purpose (RFC 8311 made NS historic), make() should reject ns instead.
System information main at b10e7951b, CPython 3.14.7, Linux.
Additional context
Found during the #719 second-round sweep, then reproduced on main.
#1114 restores it so the flag round-trips. But docs/source/pcapkit/protocols/transport/tcp.rst:538-541, written in #413 on 2026-09-16, says NS is deliberately left out because RFC 3540 was reclassified as Historic. The code change that commented it out (2e39aeb99, "minor revision for TCP on typings") gives no reason. So the footnote may be a reason written after the fact, not an original design decision.
Ruling from the maintainer: option (1), expose NS. #1114 keeps the change to the Flags model, and the tcp.rst footnote saying NS is deliberately hidden is being removed.
Activity
JarryShaw commentedon Oct 6, 2026
Decision needed: should NS be exposed in
Flags?#1114 restores it so the flag round-trips. But
docs/source/pcapkit/protocols/transport/tcp.rst:538-541, written in #413 on 2026-09-16, says NS is deliberately left out because RFC 3540 was reclassified as Historic. The code change that commented it out (2e39aeb99, "minor revision for TCP on typings") gives no reason. So the footnote may be a reason written after the fact, not an original design decision.make()rejectns, or ignore it and say so. Todaymake()writes a bit that parsing never reports.Either way the footnote changes. My recommendation is (1), because the bit is on the wire and
make()already accepts it.JarryShaw commentedon Oct 6, 2026
take (1)
JarryShaw commentedon Oct 6, 2026
Ruling from the maintainer: option (1), expose NS. #1114 keeps the change to the
Flagsmodel, and thetcp.rstfootnote saying NS is deliberately hidden is being removed.fix(tcp): NS flag is written by make() but never parsed
fix(tcp): NS flag is written by make() but never parsed