ef: fix rx ign never matching a named frame - #20
Open
jeso-mchp wants to merge 1 commit into
Open
Conversation
'rx <if> ign name <ref>' silently absorbed nothing: every frame reaching the interface was counted RX-ERR, including one byte-identical to the named frame. The equivalent with an inline frame spec worked. The ign matcher compares only the first frame_size_no_padding bytes of the frame and bails out when that length is 0. The length is computed in argc_cmd, but only on the inline-spec path: a 'name <ref>' reference returns early, before the summation, and copy_cmd_by_name cloned frame, frame_buf and frame_mask_buf without it. So an ign command referring to a named frame kept a length of 0 and was skipped for every frame. Propagate frame_size_no_padding in copy_cmd_by_name alongside the other three clones. The named definition always has it computed, since a 'name <n> <spec>' command cannot take the reference early return and so always parses an inline spec. Recomputing it from the cloned frame stack would duplicate the parser's summation in a second file. Only the ign path was affected. Regular rx matching uses frame_buf and frame->padding_len, both cloned correctly, so 'rx <if> name <ref>' worked before and is unchanged. Extract the frame pairing loop from exec_cmds into resolve_named_frames so the tests can drive name resolution without a socket. Behaviour is unchanged.
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.
'rx ign name ' silently absorbed nothing: every frame reaching the interface was counted RX-ERR, including one byte-identical to the named frame. The equivalent with an inline frame spec worked.
The ign matcher compares only the first frame_size_no_padding bytes of the frame and bails out when that length is 0. The length is computed in argc_cmd, but only on the inline-spec path: a 'name ' reference returns early, before the summation, and copy_cmd_by_name cloned frame, frame_buf and frame_mask_buf without it. So an ign command referring to a named frame kept a length of 0 and was skipped for every frame.
Propagate frame_size_no_padding in copy_cmd_by_name alongside the other three clones. The named definition always has it computed, since a 'name ' command cannot take the reference early return and so always parses an inline spec. Recomputing it from the cloned frame stack would duplicate the parser's summation in a second file.
Only the ign path was affected. Regular rx matching uses frame_buf and frame->padding_len, both cloned correctly, so 'rx name ' worked before and is unchanged.
Extract the frame pairing loop from exec_cmds into resolve_named_frames so the tests can drive name resolution without a socket. Behaviour is unchanged.