Conversation
69e1d55 to
fc39ced
Compare
There was a problem hiding this comment.
Pull request overview
Fixes handling around “channel RX’d” (WS_CHAN_RXD) and agent setup paths, primarily to improve forwarding behavior in the echoserver and make agent-related code compile cleanly.
Changes:
- Treat
WS_CHAN_RXDas a successful outcome for returninglastRxIdfromwolfSSH_worker(). - Silence unused-parameter warnings in agent stubs.
- Fix echoserver agent UNIX-socket setup flow so it proceeds correctly after
snprintf()and simplifies thesocket()error assignment.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/ssh.c |
Returns channelId not only on WS_SUCCESS but also on WS_CHAN_RXD so callers can identify the channel that received data. |
src/agent.c |
Adds WOLFSSH_UNUSED(agent) to avoid unused-parameter warnings when logging is compiled out. |
examples/echoserver/echoserver.c |
Corrects agent local setup flow after snprintf() and adjusts UNIX-socket bind/setup logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
676df52 to
773c3bf
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JacobBarthelmeh
left a comment
There was a problem hiding this comment.
Changes look okay. I sent a message asking about expected output and return values from running the new scripts/fwd.test.
|
Assigning to John for investigating into the test case behavior. |
cbc787b to
a097eea
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
examples/portfwd/portfwd.c:325
- The new
-R <readyFile>option is parsed, butShowUsage()doesn’t mention it. This makes the CLI help inaccurate; please update the usage text to document-Rand what it writes to the file.
while ((ch = mygetopt(argc, argv, "?f:h:p:t:u:F:P:R:T:")) != -1) {
switch (ch) {
case 'h':
host = myoptarg;
break;
case 'f':
if (myoptarg == NULL)
err_sys("null argument found");
fwdFromPort = (word16)atoi(myoptarg);
break;
case 'p':
if (myoptarg == NULL)
err_sys("null argument found");
port = (word16)atoi(myoptarg);
#if !defined(NO_MAIN_DRIVER) || defined(USE_WINDOWS_API)
if (port == 0)
err_sys("port number cannot be 0");
#endif
break;
case 't':
if (myoptarg == NULL)
err_sys("null argument found");
fwdToPort = (word16)atoi(myoptarg);
break;
case 'u':
username = myoptarg;
break;
case 'F':
fwdFromHost = myoptarg;
break;
case 'P':
password = myoptarg;
break;
case 'R':
readyFile = myoptarg;
break;
case 'T':
fwdToHost = myoptarg;
break;
case '?':
ShowUsage();
exit(EXIT_SUCCESS);
default:
ShowUsage();
exit(MY_EX_USAGE);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1. Fix a couple unused variable warnings. 2. In wolfSSH_AGENT_DefaultActions(), fix comparison to the result of snprintf() treating normal result as an error. Reset the return code for the error state of the socket() command. Better cleanup of agent startup failures.
1. Add a test script and expect script for testing forwarding. 2. Update portfwd to have a ready file option. 3. Fix echoserver error string, needed NL.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {Ut enim ad minim veniam, quis nostrud exercitation ullamco} | ||
| {laboris nisi ut aliquip ex ea commodo consequat.} | ||
| {Duis aute irure dolor in reprehenderit in voluptate velit esse} | ||
| {cillum dolore eu fugat nulla pariatur.} |
There was a problem hiding this comment.
Corrected spelling of 'fugat' to 'fugiat'.
| {cillum dolore eu fugat nulla pariatur.} | |
| {cillum dolore eu fugiat nulla pariatur.} |
| "/tmp/wolfserver.%d", ctx->pid); | ||
|
|
||
| if (ret == 0) { | ||
| if (ret <= 0) { |
There was a problem hiding this comment.
The condition ret <= 0 is incorrect for snprintf. On success, snprintf returns the number of characters that would have been written (excluding null terminator), which is positive. A return value of 0 would indicate an empty string was written, not an error. The condition should be ret < 0 to catch actual errors, or ret >= sizeof(name->sun_path) to catch truncation.
| if (ret <= 0) { | |
| if (ret < 0 || (size_t)ret >= sizeof(name->sun_path)) { |
Uh oh!
There was an error while loading. Please reload this page.