Repository navigation
fix(application)!: read OSPFv3 with its own 16-octet header (#3105) - #3107
Conversation
Documentation build overview
34 files changed ·
|
|
GOOD TO GO at
|
|
NEEDS CHANGES per your design ruling. Versions that differ significantly get separate classes under a shared base. One class is fine only when a version is a field change plus extra features, and explicit classes are generally better for both parsing and construction.
|
|
Adding OSPFv1 as well, per your follow-up: version 1 existed (RFC 1131, obsoleted by RFC 1247), so the family is |
f54b4bf to
26a6b41
Compare
|
Coverage: 94.71% (unit tier, Python 3.15,
Per-file detail: the |
|
NEEDS CHANGES at
Also to fix:
The worker is applying (A) and (A) meanwhile. |
OSPF read every version with OSPFv2's 24-octet header, though RFC 5340 A.3.1 gives OSPFv3 16 octets with an Instance ID and no authentication. * OSPF becomes the abstract base of a versioned family: OSPFv1 (RFC 1131), OSPFv2 (RFC 2328) and OSPFv3 (RFC 5340), each a package with its own schema and data model. The base picks the member by the Version octet on parse, by version= on build, and by the data's version in from_data; any other version is refused, and left Raw behind IP protocol 89. * OSPFv2 keeps 1.8.0's octets and info; OSPFv1 names RFC 1131's AuType and packet types in a new pcapkit.const.ospfv1, keeps its Authentication raw and checks its checksum; OSPFv3 hands the body on at octet 16. * ospf.schema and ospf.data move to ospfv2, with no alias; the members are registered and exported. * protocol-family-grouping.rst records the ruling: versions that differ significantly are separate members under a shared base. * Tests: test_ospf_family_3105_unit, the edge table's v1 and v3 cases, and the OSPF pins moved to the members.
26a6b41 to
345ba5c
Compare
|
GOOD TO GO at
|
|
Take both recommendations |
|
Taking both, and |
|
Ready to merge at |
Please follow the guide below
Put an
xinto every box [ ] that applies to your pull request (like this: [x])Use the Preview tab to see how your pull request will look
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeDescribed the user-visible change below and left its changelog entry to the maintainer, keeping
docs/source/changelog/andCHANGELOG.mdout of the diff, if the change is user-visible: N/A — centralisedWhat is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseAlso tick if it regenerates constant or registry tables, members keeping their numeric values (the
constlabel)Description of your pull request and other information
Closes #3105. Merge only after the 1.8.0 release finishes: Create Release is running on
main, and a push mid-chain breaks it.flowchart TD IP["IPv4 / IPv6, protocol 89"] --> OSPF["OSPF (abstract base)"] OSPF -->|"Version 1"| V1["OSPFv1, RFC 1131: 24 octets"] OSPF -->|"Version 2"| V2["OSPFv2, RFC 2328: 24 octets"] OSPF -->|"Version 3"| V3["OSPFv3, RFC 5340: 16 octets"] OSPF -->|"any other"| RAW["Raw behind IP; ProtocolError parsed directly"]OSPF(octets),OSPF.from_fields(version=…)andOSPF.from_datagive the member, as L2TP and IGMP do (refactor(protocols): every versioned family base dispatches on read and make (IGMP, IP, ICMP, L2TP, LinuxSLL) #2574); fields withoutversion, and a version with no member (each RFC requires its own, RFC 1131/2328 §8.2, RFC 5340 §4.2.2), are refused. Behind IP,OSPF._dispatchleaves such a packetRaw, as IGMP's hook does.ospf.schema/ospf.data(withospf_auth_data_selector), theSchema_*/Data_*aliases and the base'sread/make/lengthmove to the members, with no alias. OSPFv3 info hasinstance_id/reserved, notautype/auth. OSPFv2 octets and info matchmain.pcapkit.const.ospfv1registries for the AuType (0, 1) and packet types (1–5) RFC 1131 defines, generated fromDATAcrawlers aspcapkit.const.sslv2is. It keeps Authentication raw and checks its checksum.protocol-family-grouping.rstrecords the ruling next to Member Shapes, and lists OSPF among the dispatching bases.test_ospf_family_3105_unitfails 22 of its 23 tests onmain(the scapy fixture check passes by design); its refusal, OSPFv1-registry and 1.8.0-info tests (4) fail on the previous head26a6b413d.Tests (3.14,
-n 4, aftermake samples):tests/protocols3875 passed, 4 skipped;tests/project,tests/constandtests/vendor3129 passed, 88 skipped.