portfwd: report the channel open response - #1232
Merged
Merged
Conversation
ejohnstown
requested review from
wolfSSL-Fenrir-bot
and
a lite review from Copilot
September 3, 2026 00:18
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes are localized to an example program, match the wolfSSH callback signatures/usage, and don’t introduce risky control-flow or API changes.
Pull request overview
This PR improves the examples/portfwd forwarding client’s observability by wiring up the channel-open confirm/fail response callbacks and reporting which locally-tracked channel ID was confirmed or refused.
Changes:
- Added channel-open response callbacks that print a per-channel “confirmed” vs “failed” message.
- Registered the confirm/fail callbacks via
wolfSSH_CTX_SetChannelOpenRespCb()and provided per-session context viawolfSSH_SetChannelOpenCtx(). - Ensured the reported channel identifier is the client’s own (“self”) ID, which is available even when an open is refused.
File summaries
| File | Description |
|---|---|
| examples/portfwd/portfwd.c | Adds and registers channel-open confirm/fail callbacks to report per-channel open outcomes using the locally-known channel ID. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
wolfSSH_CTX_SetChannelOpenRespCb() had no caller anywhere in the tree, so the confirm and fail hooks had no worked example and a forwarding client had nothing to say which of its opens the peer refused. - register both arms and print the channel each one names - name our own id, not the peer's: a refused open never learns the peer's, and it is the id portfwd_worker() already tracks
ejohnstown
force-pushed
the
ccb-phase2-4c
branch
from
September 4, 2026 04:40
84bec25 to
e926934
Compare
ejohnstown
requested review from
wolfSSL-Fenrir-bot
and removed request for
wolfSSL-Fenrir-bot
September 4, 2026 04:42
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1232
Scan targets checked: wolfssh-bugs, wolfssh-src
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
philljj
approved these changes
Sep 6, 2026
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.
wolfSSH_CTX_SetChannelOpenRespCb() had no caller anywhere in the tree, so
the confirm and fail hooks had no worked example and a forwarding client
had nothing to say which of its opens the peer refused.
peer's, and it is the id portfwd_worker() already tracks.