Repository navigation
fix(tcp): MPTCP options round-trip byte-exactly (#1212-#1217, #1220) - #1254
Merged
Merged
Conversation
Contributor
|
Coverage: 88.92% (unit tier, Python 3.14,
Per-file detail: the |
Owner
Author
|
Cross-review verdict on
|
- Map the reserved bits of MP_JOIN, DSS, REMOVE_ADDR, MP_PRIO, MP_FAIL and MP_FASTCLOSE into the schemas and keep them in a new `reserved` data-model field. - MP_FAIL reads its 12 reserved bits, so the DSN starts at offset 4. - Unknown subtypes size their data as `length - 3`. - DSS keeps the `a`/`m` flags (`ack_wide`/`dsn_wide`) and they decide the field widths; the checksum is present only when the length has room for it. - ADD_ADDR follows RFC 8684: family, port and HMAC from the length, `reserved`/`echo` bits and an optional `hmac`; RFC 6824 options still parse and round-trip. - MP_CAPABLE keeps the C flag (`deny_join`) and bits D-G (`reserved`). New data-model fields are required arguments, so existing tests that build these models directly are updated.
JarryShaw
force-pushed
the
fix/mptcp-roundtrip
branch
from
October 7, 2026 18:25
634ac75 to
7eb1b21
Compare
Owner
Author
|
Cross-review verdict on
|
This was referenced Oct 7, 2026
fix(tcp): bytes after EOOL are dropped and the Data Offset is recomputed, shrinking the header
#1218
Closed
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
make pylint,make mypy,make isort) — run on the three changed modules with the Makefile flags; no new message kindsmake testpasses, and a test case covers the change — the modules listed below only, not the full suitedocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A, added centrallyWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #1212
Closes #1213
Closes #1214
Closes #1215
Closes #1216
Closes #1217
Closes #1220
Every MPTCP subtype now rebuilds byte-exactly. Reserved bits are mapped and kept. MP_FAIL reads its 12 reserved bits, and unknown subtypes read
length - 3. DSS widths followa/m, and its checksum follows the length. ADD_ADDR takes its family, port and HMAC from the length (RFC 8684), and RFC 6824 options still round-trip. MP_CAPABLE keeps C and D–G.Breaking: these are new required data-model fields:
reservedonMPTCPJoinSYN/SYNACK/ACK,MPTCPDSS,MPTCPRemoveAddress,MPTCPPriority,MPTCPFallbackandMPTCPFastcloseack_wideanddsn_wideonMPTCPDSSreserved,echoandhmaconMPTCPAddAddressdeny_joinandreservedonMPTCPCapableFlagMPTCPAddAddress.versionnow comes from the address family. The schematestdicts gainedreserved/echokeys, and the ADD_ADDR one lostversion.mptcp_add_address_selectorreadslength.make()output is unchanged by default. The ADD_ADDR maker now rejects anhmacthat is not 8 octets, or one given withecho=True.Probe (24 option repros,
TCP.from_data(TCP(raw,len(raw)).info).data): 19 DIFF/ERR before (the 3 controls already OK) → 24 OK after. Fixtures: 1259 TCP frames round-trip, 0 bad.Tests:
test_mptcp_roundtrip_unit.py: 12 passed, 36 subtests. With the three source files reverted tomain, 38 failed.test_tcp_udp_unit,test_tcp_mptcp_addaddr_unitandtest_tcp_mptcp_error_message_unittests now build the new fields. One rejection case moved from version 5 to length 9, and theOptNocount went 33→35. Thetests/corekit/test_fields_misc.pyADD_ADDR rows now pass lengths 8 and 20.test_option_roundtrip_unitandtests/project(389 passed) all pass. Theprotocols --exclude protocols/internetunittest leg ran 862 tests OK.test_fields_misc10 passed,test_fields_ipaddress23 passed.