Repository navigation
feat(link): decode radiotap TLV items a producer cut short (#2655) - #2690
Merged
Merged
Conversation
Owner
Author
|
GOOD TO GO at
The review found two test gaps, which the worker is adding: EHT cuts at 1 and 3 octets into a user word, and a list-form record. I corrected the body: only |
radiotap.org lets a producer leave off the octets it does not fill at the end of a TLV item, and a parser reads them as zeros. Such an item stayed raw. - _read_tlv_data unpacks data short of its schema, or of the vendor header, at the schema's full length, rounded up to a whole list item, so Schema.unpack zero-fills it and records the cut; the decoded data keeps it as __short_read__. Data past a fixed layout stays raw. - _make_tlv_data packs through _pack_tlv_data, which hands the record back to the schema, so Schema.pack writes the octets as captured. A malformed record, or vendor data after a cut header, raises ProtocolError. - Both unpacks share the CaughtByCaller(FieldValueError) guard, so a cut the zero-pad limits refuse stays raw, quietly. - The module docstring, radiotap.rst, the TLV data model and make()'s Raises describe it. - Tests: U-SIG, S1G, EHT and vendor items cut at a field boundary and inside a field, each against its zero-padded control; from_data and make() round trips; quietness; the padding-limit refusal; a registered layout. The #2576 pins on a short S1G and a ragged EHT now expect them decoded.
JarryShaw
force-pushed
the
feat/2655-radiotap-short-tlv
branch
from
November 2, 2026 21:33
437e17a to
c3fc0d3
Compare
Owner
Author
|
Pushed |
5 tasks done
JarryShaw
added a commit
that referenced
this pull request
Nov 2, 2026
…h refusals and the Windows leg's argument file into 1.6.0 (#2449) - Breaking: MH(raw) and TCP(raw) (#2683) raise ProtocolError for an MH message whose Header Len is short of its fields, or a DSS option of a length its flags do not give, where 1.5.x read the gap as zeros and rebuilt it longer; a cut MH keeps its declared Header Len. The entry gives the old and new results, measured against v1.5.1. - Folded into unreleased entries: radiotap's decoded optional fields, Radiotap.__field__ with register_field and register_radiotap_field, the RadiotapField schemas and pcapkit.const.radiotap with its crawlers (#2657), and cut TLV items decoding zero-padded (#2690), into the Radiotap entry, with the IEEE 802.11 entry's Flags clause corrected; #2657's ruling on code to layout tables, into the conventions entry; the Windows leg's argument file (#2681), into the CI legs entry, as the cycle's other CI changes have entries. - No entry for the test-only 42a6133. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
1 of 5 tasks
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?
feat— adds a featureDescription of your pull request and other information
radiotap.org's TLV page says a producer may omit an item's trailing zero octets. A TLV item shorter than its layout was kept raw. It now decodes as its layout padded with those zeros. For example, a U-SIG TLV of 8 of its 12 octets now decodes.
The cut is
Schema's built-in short-read record._read_tlv_dataunpacks the item at its layout's full length, soSchema.unpackzero-fills it and records the cut._make_tlv_datahands that record back, soSchema.packwrites the octets as captured throughmake().from_datareplays the captured fields, as before. When the zero-pad limits refuse the padding, the item stays raw and nothing is logged. Items longer than a fixed layout stay raw.Following the same rule, a cut EHT user word and a vendor TLV cut inside its header decode too.
U-SIG, S1G, EHT and vendor items cut at a field boundary and inside a field are each compared with the whole item. Every test fails on
main. Whole items, #2576's library vectors and every sample capture are unchanged frommain.Closes #2655