Repository navigation
fix(pfm): reject fractional retries in forward memo metadata instead of truncating - #9128
Open
HusseinAdeiza wants to merge 1 commit into
Open
HusseinAdeiza wants to merge 1 commit into
HusseinAdeiza wants to merge 1 commit into
Conversation
|
This PR does not match any of the 1 configured review trigger rule. |
HusseinAdeiza
force-pushed
the
fix/pfm-fractional-retries
branch
from
October 24, 2026 23:11
8530b96 to
1736475
Compare
…of truncating `getForwardMetadata` parsed the `retries` field as a JSON float64 and cast it straight to uint8, so a fractional value like 2.9 was silently truncated to 2 while out-of-range values were already rejected. Treat a non-integer value as malformed metadata with a clear error, matching the existing range rejection. Adds a fractional-retries error case to the metadata error-case table; the test fails against unpatched code (verified by stash-run-restore). Fixes lfdt-ibc#9114 Signed-off-by: Hussein Adeiza Yunusa <HusseinAdeiza@users.noreply.github.com>
HusseinAdeiza
force-pushed
the
fix/pfm-fractional-retries
branch
from
November 23, 2026 02:51
1736475 to
ec390f6
Compare
Author
|
Rebased onto main. |
This branch has not been deployed
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.
Fixes #9114
Problem
getForwardMetadataparsed the forward-memoretriesfield as a JSONfloat64and cast it straight touint8, so a fractional value such as2.9was silently truncated to 2 and the packet forwarded with the wrong retry count. Out-of-range values (-1,256) were already rejected - only the non-integer case slipped through.Fix
Reject non-integer values with
retries must be an integerbefore the range check:Verification
Added a
fractional retries value(2.9) case to the existingTestGetPacketMetadataErrorCasestable:An error is expected but got nil) - verified via stash/test/restorego test ./modules/apps/packet-forward-middleware/...passes with the fixgo vet/gofmtclean