Send Large Forward Open service code (0x5B) when large_open is set - #24
Closed
dhruvkpatel wants to merge 1 commit into
Closed
Send Large Forward Open service code (0x5B) when large_open is set#24dhruvkpatel wants to merge 1 commit into
dhruvkpatel wants to merge 1 commit into
Conversation
forward_open in src/adapters/eip.rs hardcoded the standard Forward Open service code 0x54 even when OpenOptions::large_open was set. rseip already encodes the request body in large-parameter format (32-bit network connection parameters) in that case, but sending it under the standard service code makes the target parse a large-format body as a standard request. Observed on a live Allen-Bradley ControlLogix: the Large Forward Open is rejected with general status 0x01 / extended status 0x0111, so no connected reads succeed. pycomm3 sends the Large Forward Open service code 0x5B (SERVICE_LARGE_FORWARD_OPEN) and works. Select the service code from request.large_open: 0x5B for a large open, 0x54 otherwise. Forward Close is unaffected and the reply decode does not assert a specific reply service code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
OpenOptions::large_open(true)makesforward_openencode the request body withlarge-format (32-bit) network connection parameters, but the request is still sent
with service code
0x54(standard Forward Open). No Large Forward Open is actuallyissued — a large-format body goes out under the standard service code.
Impact
Targets that require the Large Forward Open service code reject or ignore the
request. On a live Allen-Bradley ControlLogix, the request is rejected with general
status
0x01/ extended status0x0111, which makes large (>511-byte) connectionsunusable — the exact case
large_openexists to enable.pycomm3sends0x5Bforthis case and works.
Fix
Select the service code from
request.large_open:SERVICE_LARGE_FORWARD_OPEN(0x5B) for a large open,SERVICE_FORWARD_OPEN(
0x54) otherwise. The reply decode and Forward Close paths are unchanged.CIP Vol 1 defines Large Forward Open as its own service (
0x5B), distinct fromForward Open (
0x54); the two differ in the width of the network connectionparameters, so the service code has to match the body format.