Skip to content

Commit f124d23

Browse files
committed
Peer review fixes
1 parent dcfefd5 commit f124d23

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/port/stm32h563/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,15 +661,15 @@ entirely.
661661

662662
**Fix (already applied):** `ssh_server.c` detects `wolfIP_sock_accept()` returning
663663
`-1` and automatically calls `ssh_reinit_listen()` to close and recreate the
664-
listen socket on port 22. In addition, `wolfSSH_shutdown()` is now skipped for
664+
listen socket on the configured SSH port. In addition, `wolfSSH_shutdown()` is now skipped for
665665
connections that never reached the authenticated (`CONNECTED`) state, which
666666
reduces the CLOSING-state latency and narrows the timing window.
667667

668668
**If the issue re-occurs** (e.g. after a very rapid series of failed attempts),
669669
UART will now show:
670670

671671
```
672-
SSH: Listen socket error, reinitializing
672+
SSH: Reinitializing listen socket
673673
SSH: Listen socket recovered
674674
```
675675

src/port/stm32h563/ssh_server.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,10 @@ int ssh_server_poll(void)
371371
* client ACK arrived before wolfIP_sock_accept() was called,
372372
* or destroyed after TCP_CTRL_RTO_MAXRTX retries).
373373
* Reinitialize to recover. */
374-
ssh_reinit_listen();
374+
if (ssh_reinit_listen() < 0) {
375+
debug_print("SSH: Listen reinit failed\n");
376+
return -1;
377+
}
375378
}
376379
break;
377380

0 commit comments

Comments
 (0)