cederom commented on PR #22441: URL: https://github.com/apache/nuttx/pull/22441#issuecomment-7247700875
Thanks — the behaviour change looks right to me: `TCP_CORK` 1 no longer fails with `ENOSYS`, 0 still works, the value is reported back by `getsockopt()`, and `TCP_NODELAY` is unchanged (0 still refused, wrong length still `-EDOM`). nxstyle is clean on all three files. A few small points, none blocking: 1. **Commit 1 message** says "the alignment of a block and two comments", but the diff realigns one block and one comment (`/* Reset timer */` in `tcp_setsockopt.c`); `tcp_getsockopt.c` only gets blank lines. Maybe "a block and a comment". 2. **Flag bit instead of a new field (optional).** `conn->flags` is `uint16_t` and only bits `0x01`–`0x80` are used (`TCP_WSCALE` … `TCP_SYNFIRST`). A `TCP_CORKED 0x0100U` there would keep the per-connection option state in one place, and the commit message would not need to argue about the padding hole. Right now `cork` is an unconditional field that is only read and written under `CONFIG_NET_TCPPROTO_OPTIONS` (compare `user_mss`, which is guarded). If you keep the `bool`, consider guarding it the same way. 3. **Nit, `tcp_getsockopt()`:** the local is still called `nodelay`, but now it holds the `TCP_CORK` value as well. Something like `optval` would read better. 4. **Question, accept inheritance:** `tcp_alloc_accept()` copies `user_mss` and `keepalive` from the listener. Should `cork` be copied too, or is it deliberately per-connection? Either is fine for a hint; I'm just checking it was a deliberate choice, since `test_tcp_accept_inherit` covers the other options. -- 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]
