Repository navigation
fix(pcapng): rebuild a block's info with the options and trailer its parse read (#2776) - #2778
Merged
Merged
Conversation
…parse read (#2776) PCAPNG._make_options_trailer appended the octets after opt_endofopt to the options as raw bytes. A rebuilt block's info is read off the schema make() built, where _read_pcapng_options takes a bytes item for an area kept as captured, so from_data(info) and from_data(info.to_dict()) lost every option and padding_opts on SHB, IDB, PB, NRB, ISB, EPB and DSB, octets intact. The trailer now goes in the padding field after the options, where the parse reads it: _make_options_trailer only counts it for the block length, and each of those makers writes it back through _make_padding. test_pcapng_trailer_info_2776_unit asserts from_data(info).info == info, from info and to_dict(), for every #1437 case; 14 subtests fail without it.
Owner
Author
|
GOOD TO GO at
|
1 of 5 tasks
JarryShaw
added a commit
that referenced
this pull request
Nov 4, 2026
- #2777: the cut-header sentence reads the length back too, the rebuild read at the width its parse was given (__short_width__); the ruling into the conventions entry. - #2778: a PCAP-NG block with octets after opt_endofopt rebuilds an info holding its options and padding_opts, where 1.5.1 rebuilt none, into the whole-header rebuild entry; 1.5.0's frozen entry is left as written. - #2779: SCTP's reorder, the source-ordered member lists and the sorted Option.register clash warning ('opt', 'if', 'epb', ... in 1.5.1), into the member-order entry; the layer-grouped registry and the warning name restore ('put back silently' in 1.5.1), into the #2770 entry; the page wording into the conventions entry. - #2781: import_lock serialising first resolutions, into the lazy-import entry; the removed registry lock never shipped and stays unnamed. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
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.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
A PCAP-NG block with octets after
opt_endofoptrebuilt to exact octets, but its rebuiltinfolostpadding_optsand every option.PCAPNG._make_options_trailerput the trailer intooptionsas rawbytes, and onunpack,_read_pcapng_optionstreated that entry as an area kept as captured and returned no options.padding/padding_optsfield, where the parse reads it._make_options_traileronly counts it toward the block length, and each of the seven makers writes it with_make_padding, mirroring its reader. The packed octets don't change._make_options_trailerloses its now-unusedoptionsargument. It shipped in 1.5.1, so it gets aversionchanged:: 1.6.0.from_data(info).info == infoand itsto_dict()form for every block in the fix(corekit): PaddingField sites outside #1223 still zero-fill their padding on rebuild #1437 table. It fails on main with 14 failures (7 blocks × 2 forms) and passes here. The fix(corekit): PaddingField sites outside #1223 still zero-fill their padding on rebuild #1437 module still passes.Closes #2776