Skip to content

portfwd: report the channel open response - #1232

Merged
philljj merged 1 commit into
wolfSSL:masterfrom
ejohnstown:ccb-phase2-4c
Sep 6, 2026
Merged

portfwd: report the channel open response#1232
philljj merged 1 commit into
wolfSSL:masterfrom
ejohnstown:ccb-phase2-4c

Conversation

@ejohnstown

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 via wolfSSH_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.

@ejohnstown ejohnstown self-assigned this Sep 3, 2026
@ejohnstown
ejohnstown removed the request for review from wolfSSL-Fenrir-bot September 4, 2026 04:39
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

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ejohnstown
ejohnstown requested a review from philljj September 4, 2026 23:21
@ejohnstown ejohnstown assigned wolfSSL-Bot and unassigned ejohnstown Sep 4, 2026
@philljj
philljj merged commit ba6bc66 into wolfSSL:master Sep 6, 2026
172 checks passed
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.

5 participants