Repository navigation
fix(ipx,ah): IPX from_data raises struct.error; AH reserved field written back as zero - #1338
Merged
Merged
Conversation
…tten back as zero - IPX: rebuild the 12 address octets from the parsed network, node and socket values; `make` takes `total_length=None` and writes a given value as is, so `from_data` keeps the parsed packet length. - AH: the reserved field is a UInt16Field, carried as `AH.reserved` in the data model and as `make(reserved=0)` (RFC 4302 section 2.3). - Update the IPX and AH `_make_data` unit tests, which pinned the old pass-through and the missing reserved key. Closes #1315 Closes #1327
Owner
Author
|
Cross-review verdict on
Nits, none blocking: the docstring says only "zero on send"; it should also say the field is ICV-covered, which is the real reason to carry it through. An out-of-range |
Contributor
|
Coverage: 88.91% (unit tier, Python 3.14,
Per-file detail: the |
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 — ran
isortandpylinton the touched files (no new findings beyond existing too-many-arguments/redefined-builtin);mypyreports no errors in them. Did not run themaketargets.make testpasses, and a test case covers the change — ran only the modules listed belowAdded a changelog entry — N/A, added centrally
fix— corrects a defectCloses #1315
Closes #1327
_make_datanow packs the parsedAddressback into 12 octets (network, node, socket);makegainstotal_length=Noneand writes a given value as is, so the parsedlensurvives.UInt16Field, carried asAH.reservedin the data model andmake(reserved=0)(RFC 4302 §2.3).Data_AH.reserved; newIPX.make(total_length=)keyword.test_ipx_unit.py/test_ah_unit.py:_make_datatests pinned the old pass-through / missing key; updated.Probe (
from_data(parsed.info).data): before, IPX0000001e+26×00→struct.error; AH0604dead…→06040000…. After: both byte-exact.Tests: new
test_ipx_ah_roundtrip_unit.py5 passed (7 subtests); without the fix 7 failed; with only the address half, the two length subtests fail.test_ipx_unit3 passed,test_ah_unit4 passed,test_option_roundtrip_unit6 passed,tests/project389 passed 1 skipped;run_unittest_leg.py protocols/internet508 tests, 0 failures.