cederom commented on PR #22144: URL: https://github.com/apache/nuttx/pull/22144#issuecomment-7084840940
Re-reviewed the new head (range-diff against the previous one). **Resolved** - `net/tcp: Process a segment without data after a gap`: an empty segment after a gap now goes to the window update and the state machine only if `seq < rcv_adv`. Anything at or past the advertised right edge still gets the ACK and is dropped, so `snd_wl1` can no longer be pushed ahead by an out-of-window segment. With a zero window (`rcv_adv == rcvseq`) only `seq == rcvseq` is accepted, which is what RFC 9293 3.10.7.4 says. `rcv_adv` is set on the passive side too (`tcp_conn.c`, then updated by the SYN-ACK in `tcp_send()`), so the SYN_RCVD case is covered. I checked ESTABLISHED, FIN_WAIT_1 and FIN_WAIT_2: with `d_len == 0` and no FIN, none of them uses `rcvseq` in a way that breaks when `seq != rcvseq`. - `TCP_SYNFIRST` is now `0x80U`. - The first-SYN path now calls `tcp_setsequence(conn->sndseq, conn->rexmit_seq)`, the same as the resend path. - `NET_TCP_MAXSYNRTX` has help text, and it is correct for both sides: SYN_RCVD also checks `nrtx >= TCP_MAXSYNRTX` before `nrtx++`, so the first SYN-ACK is not counted either. - `psock_teardown_callbacks()` gets `OK` for `-EINPROGRESS`. **Remaining** 1. **Rebase.** The base `c51b1af1` is about 27 commits behind master, and master has since changed `tcp.h`, `tcp_connect.c`, `tcp_monitor.c` and `tcp_timer.c` (e2c6fadc, 4daa109a, e770d571, e54d0677, ...). I rebased locally: it applies with no conflicts. I read the merged `tcp_start_monitor()` and found nothing that clashes with the `_SS_ISCONNECTING` change. Please still rebase so CI runs against current master. 2. **Impact section.** Please name the in-tree users that set `SO_SNDTIMEO` before a blocking `connect()` and treat any error as fatal: `netutils/webclient` (its configured timeout) and `system/nxplayer` (a hard-coded 10 s). Both will now fail on a handshake slower than that timeout. 3. **Follow-up, not blocking:** calling `connect()` again while the handshake is still running gives `EISCONN` (from the state check in `tcp_connect()`), where Linux gives `EALREADY`. Blocking callers can now hit this after `EINPROGRESS`. nxstyle is clean on the changed files. With the rebase and the Impact note, LGTM. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
