Repository navigation
fix(ipv6)!: rebuild a cut extension header chain byte-exact (#1471, #1473) - #1476
Conversation
|
Coverage: 89.56% (unit tier, Python 3.14,
Per-file detail: the |
|
Verdict: GOOD TO GO at
One visible value change, and the question it raises.
Not a blocker in its own right. Two follow-ups, neither needed for merge:
|
|
Sounds like a breaking change? Yea update the body as well. |
|
Recorded: the owner rules this a breaking change. I have added the |
) - beholder: a Raw fallback re-reads the `payload` the method was given, not the whole layer payload, so an upper layer cut after IPv6 extension headers no longer holds those headers a second time (#1471) - IPv6._lookup_exthdr: an entry under IPv6_Ext's key rebuilds with IPv6_Ext rather than the dedicated parser for its code, so a header whose parser raised survives from_data(info.to_dict()) (#1473) - IPv6._exthdr_key: one place for the info key of an extension header - tests: every cut of seven chains over IPv6 and Ethernet, parse, info and dict rebuilds (424 of 1036 failed before)
|
Verdict carried to |
b59db0a to
fd77588
Compare
make pylint,make mypy,make isort)make testpasses, and a test case covers the change — new test added; legs below run, not the whole suitedocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
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 elseDescription of your pull request and other information
beholder(pcapkit/utilities/decorators.py) built itsRawfallback fromself._get_payload(). It ignored thepayloadIPv6 passes for the octets past its extension headers, so a cut upper layer held those headers twice. It now uses the passedpayloadwhen there is one.IPv6._lookup_exthdrpicked the dedicated parser from thenextcode, even for an entryIPv6_Exthad parsed and written under itsextkey. The key now decides:extrebuilds withIPv6_Ext. This also fixes the HIP dict-rebuildAttributeErrornoted in fix(ipv6): a cut upper layer after an extension header falls back to Raw that duplicates the header #1471.Breaking (owner ruling on this PR):
info.raw.packetchanges when the upper layer is cut. Behind extension headers, it no longer repeats those headers: for a DST+TCP cut, it was060001040000000000and is now00. For a decrypted ESP payload, theRawfallback no longer includes the ESP trailer; it now matchesData_ESP.plaintext. The info keys,Raw.lengthand the protochain are unchanged.tests/protocols/internet/test_ipv6_exthdr_cut_rebuild_unit.pycovers every cut of 7 chains over IPv6 and Ethernet, checking the parse,from_data(info)andfrom_data(info.to_dict()). Onorigin/mainsources:429 failed, 2 passed, 1130 subtests passed. With the fix:3 passed, 1558 subtests passed.Also passing: the four edge modules,
test_capture_roundtrip_runtime.py,run_unittest_leg.py protocols/internet(620 tests, 0 failures) andtests/project. The json and tree dumps of all 23examples/capturesare byte-identical toorigin/main.Closes #1471
Closes #1473