Skip to content

fix(link): rebuild a cut FRAD header as captured and quietly, or refuse its address (#2710) - #2719

Merged
JarryShaw merged 1 commit into
mainfrom
fix/2710-frad-cut-rebuild
Nov 3, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/2710-frad-cut-rebuild

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • fix — corrects a defect

A FRAD header cut short by the capture rebuilt with different octets, and a cut before the NLPID logged a CRITICAL NoDefaultValue.

  • The CRITICAL log: a cut before the NLPID octet reads it as the 0x00 pad, giving an NLPID of 0. make() passed ext_nlpid=None, which the schema requires. It now writes the pad and an NLPID of 0, the octets that read back as it, and Schema's built-in short read cuts them back.
  • The differing octets came from Q.922 address forms the data model cannot hold: EA bits other than 0 then 1. read now refuses such an address with ProtocolError. A missing EA2 is exempt only when this model's own ('addr', n) record shows the capture cut the address. Behind LinuxSLL or a LINKTYPE_FRELAY capture, the frame is kept as Raw and nothing is logged.

Every cut of direct, SNAP and pad-then-zero frames rebuilds exactly and quietly, through both from_data(info) and from_data(info.to_dict()). The new tests fail on main. FRAD has not shipped, so the refusal breaks no release. The whole-frame pad defects are #2716, and the Raw versus NoPayload next layer is #2717.

Closes #2710

…se its address (#2710)

- A header cut before its NLPID reads that octet as the 0x00 pad, so its data
  model holds an NLPID of 0. FRAD.make left out the ext_nlpid the schema reads
  after the pad, and the rebuild logged NoDefaultValue at CRITICAL. It writes
  the pad and an NLPID of 0, which the schema's own short read cuts back.
- The data model keeps no EA bits and make writes the 2-octet form's 0 then 1,
  so a header with other EA bits rebuilt other octets, cut or whole, alone or
  behind LinuxSLL: the octets #2710 saw differ. FRAD.read refuses an address
  that is not the 2-octet form, the only one the schema reads; an EA bit the
  capture cut off is not checked. LinuxSLL keeps such a frame as Raw, quietly.

test_frad_cut_rebuild_2710_unit cuts FRAD frames at every octet and fails
without the pcapkit/ change. Shipped captures parse identically. The link,
internet and root protocols modules, both schema round trips, the short-read
and #2703 modules, the project guards and the plain-unittest link leg pass.

Closes #2710
@JarryShaw JarryShaw added this to the PyPCAPKit v1.6 milestone Nov 3, 2026
@JarryShaw JarryShaw added bug Issues reporting a defect (set by the bug report template; a default, not an assessment) review: good-to-go Cross-review at the current head says ready; CI state is separate labels Nov 3, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at 29088b1ea. The Sonnet review of 3ebbc15bf asked for two prose fixes, which the amend made (AST-equal with docstrings stripped). The rebase onto bd82b7632 keeps the same patch-id.

  • Every cut rebuilds exactly and quietly, checked with the reviewer's own sweep.
  • The address refusal is keyed on this model's own ('addr', n) record, so a frame cut elsewhere with EA2 = 0 is still refused.
  • The new tests fail 131 cases on the parent.

@JarryShaw
JarryShaw merged commit ddfacbd into main Nov 3, 2026
55 checks passed
@JarryShaw
JarryShaw deleted the fix/2710-frad-cut-rebuild branch November 3, 2026 02:39
@github-project-automation github-project-automation Bot moved this to Done in PyPCAPKit Nov 3, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Nov 3, 2026
JarryShaw added a commit that referenced this pull request Nov 3, 2026
… helpers, MH options 6 and 27, the cut SCTP and option-area schemas and dict-built secrets into 1.6.0 (#2449)

- Breaking: a make() enumeration field takes a member or an int, its
  X_default/X_namespace/X_reversed keywords removed with no alias, and names,
  wide codes and wide option codes are refused (#2692); the schema helpers
  move to pcapkit.corekit.schema and pcapkit.corekit.fields.byteorder is
  removed (#2704); MobileNetworkPrefixOption gains prefix_length and keeps an
  IPv6Address prefix, and TimestampOption's timestamp is None past 9999
  (#2709). Folded into the MH data-model entry; old values measured against
  v1.5.1.
- Fixed: the SCTP schema cut inside its padding and a header schema cut
  inside an option area pack back as captured (#2682), into the SCTP entry;
  a Decryption Secrets Block rebuilds from its dict as captured (#2707), into
  the DSB entry.
- Folded into unreleased entries: FRAD's Q.922 address refusal and quiet cut
  rebuild (#2719); a from_data rebuild's checksum status (#2712); a failed
  ListField fill's ledger (#2706); pad_length's path (#2704); TLS's enumeration
  fields (#2692); the make() and schema-helper rulings, into the conventions
  entry (#2692, #2704); the GraalPy shards, into the CI-legs entry (#2720).
- 1.5.0's corekit.fields.byteorder role points at corekit.schema.byteorder,
  where #2704 moved it, so the nitpicky build does not warn on it; 1.5.0's
  text unchanged.
- No entry for the test-only 72b2bd8 (#2715), or the docs-and-test-only
  0c07940 (#2718).
- CHANGELOG.md regenerated; util/changelog_md.py --check passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issues reporting a defect (set by the bug report template; a default, not an assessment)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(link): a FRAD header cut short rebuilds different octets and logs CRITICAL

1 participant