Repository navigation
fix(l2tpv2,ospf)!: keep the octets past the Length field as captured (#1455) - #1460
Merged
Merged
Conversation
…1455) L2TPv2 and OSPF read their own Length / Packet Length but no info kept the octets after it, so from_data dropped them. Each schema now bounds its payload by its length and gains a length-less `trailer` PayloadField after it; read() keeps it as info.trailer when non-empty, make(trailer=) writes it outside the declared length, and _make_data round-trips it, as IPv4/IPv6 (#1209) and IPX (#1433) do. Breaking: the payload no longer holds those octets (the OSPF cryptographic digest among them), and info gains a `trailer` key when they exist.
3 of 5 tasks
Contributor
|
Coverage: 89.51% (unit tier, Python 3.14,
Per-file detail: the |
Owner
Author
|
Verdict: GOOD TO GO at
Two pre-existing defects, not caused by this PR:
Nit: with the L flag clear, Merge note: #1454's |
JarryShaw
added a commit
that referenced
this pull request
Oct 9, 2026
…fixed #1454 merged before the three fixes, so its stale-entry check now fails on main: #1455 (L2TPv2/OSPF trailer), #1456/#1457 (RPL) and #1459 (HIP fixed bits) all come back OK. Drop those entries. The HIP fixed-bit cuts and two RPL in-IPv6 cut55 cases now parse but zero-fill, so they move under the #1451/#1458 short-read gaps. All four edge modules pass.
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.
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort): ran all three on the six touched files only; nothing new beyond the existing stub-signature androuter_idwarningsmake testpasses, and a test case covers the change: ran the modules listed belowChangelog entry: N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657
fix: corrects a defectCloses #1455
This is the same fix as #1431/#1435. The payload now stops at the declared length. A length-less
trailerfield follows it and is kept asinfo.trailerwhen it is non-empty.make(trailer=)writes it outside the length. Breaking: the payload no longer includes these octets, and that covers the OSPF crypto digest (RFC 2328 D.4.3).ppzzChecked: ARP, RARP, Ethernet, VLAN, HTTP/2, FTP and NGAP are already exact. UDP (transport, so not mine) drops octets the same way. The two other edge cases are both short reads and belong to #1458: an L2TPv2 Offset Size that points past the data, and an unpadded final SCTP chunk.
Tests: the new module passes 8 tests and 12 subtests. Without the fix, 11 fail. Also passing: the
protocols --exclude protocols/internetleg (1134 tests, OK),test_capture_roundtrip_runtime.pyandtests/project(419 passed, 1 skipped). Per-frameinfoforexamples/captures/is identical.