Repository navigation
Conversation
Require the FC 0x0F byte count to equal the rounded-up number of bytes needed by the coil quantity. Previously, larger byte counts were accepted and the coil mapping was updated instead of returning Illegal Data Value. Add regression tests for quantities 1, 8 and 9 that check the exception response and confirm that the mapping is unchanged. Fixes stephane#883.
|
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient... |
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.
modbus_reply()accepts FC 0x0F requests whose Byte Count exceeds the number ofbytes required by the coil quantity. Such requests receive a normal response and
modify the coil mapping. Require an exact, rounded-up byte count, as specified in
section 6.11 of the Modbus Application Protocol Specification V1.1b3.
Add regression tests for quantities 1, 8 and 9 that check the Illegal Data Value
exception and verify that the coil mapping remains unchanged. The setup writes
also exercise valid requests on either side of a byte boundary.
Fixes #883.
Validation:
make distcheckand finalmake checkon x86_64 Linux: passed.28/42 passed before the fix; 42/42 passed after it. Each case checks both the
response and the resulting coil mapping.
The full upstream RTU suite stops at an existing malformed FC 0x10 request in
this PTY setup, with both the unmodified and patched versions. The independent
FC 0x0F RTU matrix passes after the fix. No physical RS485 link was tested.
AI assistance was used to prepare the patch and run the validation. The
contributor reviewed the patch before submission.