Skip to content

Part #120, reject unmatched derived command dispatch - #121

Open
sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-120-derived-dispatch-validation
Open

sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-120-derived-dispatch-validation

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Part #120.

Description

Distinguish non-derived message types from failed derivative identification. Query the type metadata first, retain position-zero dispatch only for types without derivatives, and reject failed identification before any handler is invoked. Preserve matching-derivative routing and message-size validation, and propagate an unreadable message size instead of using it.

This proposes CFE_STATUS_VALIDATION_FAILURE for unmatched derived commands. Please confirm the intended dispatch/error semantics before merging; #120 remains open as a clarification issue.

Testing performed

Debian 12 arm64, GCC 12.2, EDS-enabled native cFE/OSAL build:

  • Built the production edsmsg library and the new edsmsg-dispatcher-test target.
  • All five targeted CTest targets passed: Config, ES, SB, TBL, and the dispatcher.
  • Eight new dispatcher test groups, 50 assertions, exercise matching handlers, non-derived fallback, rejected identification, metadata/size errors, and wrong message lengths. The regressions fail on the unmodified dispatcher.
  • A supplementary local check with actual generated CFE_ES command types and the real EdsLib runtime passed 27 assertions, including unknown function-code rejection and non-derived SendHk handling.
  • Both dispatcher and generated-data checks passed 100 runs under AddressSanitizer and UndefinedBehaviorSanitizer during initial validation, and were rebuilt and passed again before submission.
  • Clang-format 19, compiler warnings as errors, and git diff --check passed.

The committed test target runs within an EDS-enabled cFE build. Full standalone EdsLib validation, COSMOS, mission/network integration, and hardware testing were not run. The generated-data check was a supplementary local validation, not an additional committed target.

Expected behavior changes

No public signature changes. Unmatched derived commands are rejected instead of invoking the first handler. Genuinely non-derived commands retain handler zero. Invalid database metadata returns CFE_SB_INTERNAL_ERR.

Contributor info

Sylvester Kaczmarek, Personal. No third-party code added. Contributor License Agreement submission status is unverified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants