Skip to content

fix(protocols): export the L2TP data model from pcapkit.protocols.data.link (#1797) - #1806

Merged
JarryShaw merged 1 commit into
mainfrom
fix/1797-data-link-l2tp
Oct 15, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/1797-data-link-l2tp

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else

Summary

pcapkit.protocols.data.link re-exported ARP, Ethernet, Loopback and VLAN but never L2TP, while pcapkit.protocols.schema.link exports its schema. The history shows it was not deliberate: the model arrived without touching the package.

  • data/link/__init__.py: imports L2TP, and Flags as L2TP_Flags, the <protocol>_<name> alias that IPv4_Flags and TCP_Flags use.
  • data/__init__.py: lists both, so from pcapkit.protocols.data import * binds them; no other data package exports either name.
  • data/link/l2tp.py: adds Flags to __all__, as the sibling modules list their nested models.
  • Bite: the new test fails with any of the three hunks reverted. tests/project and the L2TP tests pass.

Closes #1797

…a.link (#1797)

pcapkit.protocols.data.link re-exported ARP, Ethernet, Loopback and VLAN
but never L2TP, while pcapkit.protocols.schema.link exports its schema.
Not deliberate: the model arrived in cdb5fef without touching the
package, and no commit ever named L2TP in it or in the aggregator.

- data/link/__init__.py: import L2TP, and Flags as L2TP_Flags, the
  <protocol>_<name> alias IPv4_Flags and TCP_Flags already use.
- data/__init__.py: list both, so `from pcapkit.protocols.data import *`
  binds them; no other data package exports either name.
- data/link/l2tp.py: add Flags to __all__, as arp, vlan and ipv4 list
  their nested models.

The new unit test fails with any of the three hunks reverted.

Closes #1797
@JarryShaw JarryShaw added the fix Pull requests that fix a defect (fix: subject prefix) label Oct 15, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at 2be732fb1. A Sonnet cross-review (author: Opus) confirmed from the history that the omission was not deliberate. The alias follows the sibling packages, and from pcapkit.protocols.data import * gains no clash. Reverting each hunk fails the new test. tests/project and the L2TP tests pass, and the PR merges cleanly into main.

@JarryShaw JarryShaw added the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 15, 2026
@JarryShaw
JarryShaw merged commit 925c84e into main Oct 15, 2026
13 checks passed
@JarryShaw
JarryShaw deleted the fix/1797-data-link-l2tp branch October 15, 2026 23:56
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 15, 2026
@JarryShaw JarryShaw moved this to Done in PyPCAPKit Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(protocols): pcapkit.protocols.data.link does not export the L2TP data model

1 participant