cederom commented on PR #4171:
URL: https://github.com/apache/nuttx-apps/pull/4171#issuecomment-7247726405

   Nice, the test fails without apache/nuttx#22440: `recv()` returns `EAGAIN` 
after `SO_RCVTIMEO` instead of `ECONNRESET`. It passes with that PR. nxstyle is 
clean. Please mention the dependency in the description so CI on nuttx-apps 
isn't read as a regression before the kernel PR lands.
   
   Suggestions, none blocking:
   
   1. **Cover the `listen()`-shrink path too.** The kernel PR changes both 
callers of `tcp_backlogfree()`, but only the close is tested. A round with 2 
pending clients, then `listen(listener, 1)`, would check that exactly one 
client gets `ECONNRESET` and that `accept()` still gives the other one (its 
`recv()` times out with `EAGAIN`).
   
   2. **Cover the `CLOSE_WAIT` branch.** If a client calls `shutdown(SHUT_WR)` 
before the listener closes, the pending connection is in `CLOSE_WAIT` (the peer 
in `FIN_WAIT_2`, the case named in the kernel commit message). `recv()` on that 
client should then also give `ECONNRESET`.
   
   3. **Leak check for the deferred free.** The new risk in the kernel change 
is that the server-side connections are now freed later, from 
`tcp_close_work()`, instead of at once. 3 rounds × 2 pending connections stays 
under the default `CONFIG_NET_TCP_PREALLOC_CONNS=8`, so a leak there wouldn't 
show up. Running more rounds than the pool size (or a final listen + connect + 
accept after the rounds) would catch it.
   
   4. Nit: the other cases use `tcp_backlog_connect()` with 
`TCP_BACKLOG_CONNECT`. Plain blocking `connect()` here can hang for the full 
SYN retry time if a SYN is ever dropped, instead of failing quickly.


-- 
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]

Reply via email to