Repository navigation
fix(corekit)!: non-zero padding octets are zeroed on rebuild (#1223) - #1436
Conversation
|
Coverage: 89.47% (unit tier, Python 3.14,
Per-file detail: the |
|
Verdict: NEEDS CHANGES at
The worker is addressing the regression; the label is now |
PaddingField now packs the octets it was given, truncated or zero-filled to its width as struct's `s` format does, and zeros when it has none, so a freshly built packet is unchanged. Schema.pack delegates its padding branch to the field. Each site carries the octets through its reader, data model and make(); every maker reads the new field tolerantly, defaulting to zeros: - HOPOPT/IPv6-Opts PadN `pad`, QS report `unused` - IPv6-Frag `reserved_octet`; IPv6-Route SR0/Type 2 `reserved`, RPL `padding` - MH PadN option and Flow-ID PadN sub-option `data` (#1329) - HTTP/2 DATA/HEADERS/PUSH_PROMISE `padding`; OSPF crypto auth `reserved` - HIP: `reserved` on the 12 parameters listed on #1223 - HIP and SCTP trailing alignment padding: kept on the data model as `padding` only when not all zeros, and written back on make Existing tests that build these data models by hand now supply the new fields.
3edd77f to
0326527
Compare
|
Verdict: GOOD TO GO at
|
mypyon the 11 changed modules: no new errors vsmain(311 both);pylint/isortnot runmake testpasses, and a test case covers the change — ordering legsprotocols/internet579,protocols --exclude protocols/internet1082,corekit633: all OK;tests/project404 passed, 1 skippedWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #1223. Closes #1329 (its PadN remainder; the rest merged in #1345).
PaddingFieldnow packs the octets it was given (zeros when absent; a value of the wrong width is truncated or zero-filled, as before, so fresh builds are unchanged);Schema.packdelegates to it. Each site carries the octets through reader, data model andmake(): HOPOPT/IPv6-Opts PadNpadand QS reportunused, IPv6-Fragreserved_octet, IPv6-Route SR0/Type 2reservedand RPLpadding, MH PadN option/sub-optiondata, HTTP/2padding×3, OSPF cryptoreserved, andreservedon the 12 HIP parameters listed here. HIP and SCTP trailing alignment padding is kept as apaddingattribute only when non-zero.Breaking: the data models above gain required fields; five existing test modules that build them by hand were updated.
Before → after, e.g. HOPOPT PadN
3b000104aabbccdd→3b00010400000000→ exact; SCTP DATA…61ffffff→…61000000→ exact. New tests:tests/protocols/test_padding_kept_as_captured_unit.py,tests/protocols/internet/test_mh_padn_contents_unit.py(both fail onmain: 32 + 3 failures). TCP020405b4 00aabbccalready round-trips onmain; kept as a guard.Left for follow-up (other owners): IPv4 Quick-Start report and option padding (
ipv4.py), L2TP offset pad (link/), PCAP-NG SPB and option padding (misc/pcapng.pyreader/maker needed), and ~37 MH reservedPaddingFieldsites not listed on these issues.