Repository navigation
fix(pcapng): keep captured padding octets on rebuild (#1437) - #1441
Merged
Merged
Conversation
- PCAP-NG padding rebuilt as zeros: SPB/EPB/Packet Block packet data padding, DSB secrets padding, IDB reserved octets, and the padding of every option and NRB record. Each is now kept on the data model when it is not all zeros (`padding_data`, `reserved`, `padding`) and written back by make(); fresh builds still write zeros. - Octets after `opt_endofopt` were dropped, shrinking the block. They are kept as `padding_opts` and written back after the options. - IPv4 Quick-Start/EOOL padding and the L2TPv2 offset pad already round-trip on main; guard tests added, no code change. Refs #1437 (part B).
Owner
Author
|
Verdict: GOOD TO GO at
Nits, which are the owner's call:
|
Contributor
|
Coverage: 89.49% (unit tier, Python 3.14,
Per-file detail: the |
This was referenced Oct 9, 2026
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.
mypyon both changed modules shows the same 5 errors asmain;pylint/isortnot runmake testpasses, and a test case covers the change: legsprotocols/internet583,protocols --exclude protocols/internet1103,protocols/misc385, all OKWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Refs #1437 (part B). Part A, the MH sites, is a separate PR.
Measured on
mainfirst:…61eeeeee…came back as…61000000…. Octets afteropt_endofoptwere dropped, so SHB24000000 … 00000000 ddddddddrebuilt at length0x20. The reader now keeps each one on the data model through the shared_read_padding/_make_paddinghelpers:padding_data,reservedandpaddingonly when not all zeros, andpadding_optswhenever present, written back after the options.make()writes them back, and fresh builds still write zeros. The new keys are optional, so no data model gains a required field.Tests:
tests/protocols/misc/test_pcapng_padding_kept_1437_unit.py(22 failures and 1 error onmain) andtests/protocols/test_ipv4_l2tp_padding_guard_1437_unit.py(a guard that passes onmain). Per-frameinfoacross the 23make_samples.pycaptures is identical before and after.