Repository navigation
fix(tcp)!: reserved bits, post-EOOL octets and the UTO granularity round-trip (#1211, #1218, #1219) - #1348
Conversation
|
Cross-review verdict on
Minor, same class: editing a parsed UTO with G clear to 40000 s raises Held up:
|
…und-trip (#1211, #1218, #1219) - #1211: name the reserved bits of the header (octet 12, bits 4-6), the POC-SP Filler and the Quick-Start Resv./R bits in the schema, carry them in Flags.reserved, PartialOrderServiceProfile.reserved and QuickStartResponse.reserved/nonce_reserved, and write them back. - #1218: keep the octets after EOOL as TCP.padding and re-emit them while the options still end with EOOL, so the rebuilt Data Offset matches the parsed one; once the EOOL is edited out the padding is dropped and the Data Offset is recomputed. - #1219: store the G bit as UserTimeout.granularity and honour it in the maker while the value still fits in that unit, switching unit otherwise; the maker also takes an explicit granularity keyword, and the too-large error reports the actual value. Breaking: new required data-class fields, and the offset/profile/flags/nonce BitField dicts need a 'reserved' key. Existing tests that build those schemas and data by hand are updated to the new shape.
1fd285e to
72615ea
Compare
|
Round-2 verdict on The blocker is fixed:
UTO units: seconds stay seconds while they fit in 15 bits and minutes stay minutes only for whole minutes, so 40000 s with G clear becomes 666 min ( Tests: the new module fails 8 tests against the previous head and 26 against |
|
Coverage: 88.94% (unit tier, Python 3.14,
Per-file detail: the |
mypyandisort --check-onlyare clean on the three TCP modules;pylintadds no new messages on changed lines (its existing W0613/C0301 baseline remains)make testpasses, and a test case covers the change. I ran the new module, the TCP/MPTCP modules,test_option_roundtrip_unit,tests/project, andrun_unittest_leg.py protocols --exclude protocols/internet. I did not run the full suite.What is the purpose of your pull request?
fix— corrects a defectCloses #1211
Closes #1218
Closes #1219
Refs #1223. The TCP repro there,
020405b4 00aabbcc, now round-trips because the post-EOOL octets are kept.PaddingFieldis unchanged.Before → after, on
c9676c563, comparingfrom_data(TCP(raw).info)withraw: header octet 125e, POC-SP0a033f00, QS1b08834012345679, EOOL00010101 020405b4at DO 7, and UTO1c048005all used to come back mismatched. Now all are byte-exact.Breaking: these data-class fields are now required:
Flags.reserved,PartialOrderServiceProfile.reserved,QuickStartResponse.reservedand.nonce_reserved, andUserTimeout.granularity. The TCPoffset, POC-SPprofile, QSflagsandnonceBitField dicts also need areservedkey.Data_TCPgainspaddingwhenever options are present.make()gainspaddingandreserved.paddingis re-emitted only while the options still end with EOOL. If the EOOL is edited out, the padding is dropped and the Data Offset is recomputed. A User Timeout keeps its parsed unit only while the value still fits in it, and switches unit otherwise. Six existing test modules built the old shapes by hand, so I updated them. One of them,test_tcp_mptcp_join_flag_ordering_unit, grepsmake()'s source, and its substring is now_make_tcp_options(options.Tests: the new
tests/protocols/transport/test_tcp_roundtrip_unit.pyhas 11 passed and 25 subtests passed. Againstorigin/mainit gives 26 failed and 5 passed. The new edited-data tests (EOOL removed, NOP and EOOL removed, every option removed, UTO unit switch) give 8 failed against the first revision,1fd285e7a. All 1233 TCP frames across the 22 captures still rebuild byte-exactly.test_option_roundtrip_unitgives 6 passed and 362 subtests passed, with notcpentry inEXPECTED_FAILURES. The ordering leg ran 909 tests with 0 failures, andtests/projectgives 389 passed and 1 skipped.