Repository navigation
feat(foundation)!: start a new TCP flow when a SYN without ACK reuses a flow's endpoints (#2962) - #3211
Open
JarryShaw wants to merge 1 commit into
Open
feat(foundation)!: start a new TCP flow when a SYN without ACK reuses a flow's endpoints (#2962)#3211JarryShaw wants to merge 1 commit into
JarryShaw wants to merge 1 commit into
Conversation
Owner
Author
|
Needs changes at
|
… a flow's endpoints (#2962) - A SYN or SYN-ACK opens a new TCP flow where Wireshark's dissect_tcp opens a new TCP conversation, as ruled on #2962: its direction has a base sequence number and its own differs, or the flow has seen a FIN-ACK or a RST. A direction's base is its first segment's sequence number, less one unless a SYN, or the peer's acknowledgement number less one if that comes first. A capture that starts mid-connection needs no teardown; a retransmitted SYN and a simultaneous open stay one flow. Both modes. - ACK is read from the header's flags octet, so Packet keeps its fields; a header with none, as PyShark's, keeps the teardown rule. - Buffer gains base_seq; TCP._supersedes holds the rule. - The #1739 sweep records the ACK bit's 0x10 as no pcap record length. New tests fail on origin/develop; tests/project, tests/protocols/*.py, tests/*.py and every flow-tracing module pass.
JarryShaw
force-pushed
the
feat/2962-tcp-flow-reuse
branch
from
November 29, 2026 04:32
9f6d87c to
3e1829b
Compare
Owner
Author
|
Good to go at
|
Contributor
|
Coverage: 94.93% (unit tier, Python 3.15,
Per-file detail: the |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please follow the guide below
Put an
xinto every box [ ] that applies to your pull request (like this: [x])Use the Preview tab to see how your pull request will look
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeDescribed the user-visible change below and left its changelog entry to the maintainer, keeping
docs/source/changelog/andCHANGELOG.mdout of the diff, if the change is user-visible: N/A — centralisedWhat is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseAlso tick if it regenerates constant or registry tables, members keeping their numeric values (the
constlabel)Description of your pull request and other information
Closes #2962.
dissect_tcp(epan/dissectors/packet-tcp.c) opens a new conversation, as ruled on feat(foundation): start a new TCP flow when a SYN without ACK reuses a flow's endpoints #2962: its direction has a base sequence number and itsseqdiffers, or the flow has seen a FIN-ACK or a RST. A direction's base is its first segment'sseq, less one unless a SYN, or the peer'sack - 1if a segment with ACK set comes first.bidirectional=Falsetoo.Packet.header[13] & 0x10, soPacketis unchanged; a header with no flags octet, as PyShark'sb'', keeps the teardown rule. With flags readable, a FIN counts only with ACK set, as Wireshark counts it and RFC 9293 §3.10.7.4 reads it.Buffergainsbase_seq, beforereassembly, andTCP._supersedesholds the rule; the TCP flow tracing page's glossary and state diagram follow.Tests:
tests/foundation/traceflow/test_tcp_flow_reuse_2962_unit.pyand the updateddata/test_models.pyfail on anorigin/developexport; the tracer's branch coverage rises (97.9% to 98.2%).tests/project(its Sphinx-gated modules in a docs venv),tests/protocols/*.py,tests/*.pyand every module touching flow tracing pass, buttest_conda_dev_release_gate_2458.py, which fails the same ondevelophere.Pins moved:
NOT_A_COPYintests/project/test_rfc_constants_one_home_1739_unit.pyrecords the ACK bit's0x10, anddata/test_models.pybuildsBufferwithbase_seq. The PEP's "undecided" sentence on #2962 is left to the docs sweep.