CV-Bowen opened a new pull request, #22365: URL: https://github.com/apache/nuttx/pull/22365
## Summary `net/rpmsg: report a rejected connect via SO_ERROR`: when the peer rejects a pending connect with NS_DESTROY because no server is listening yet, `rpmsg_socket_ns_unbind()` wakes the waiter but leaves `s_error` at 0. A non-blocking connect that reads `SO_ERROR` after `poll()` (as libuv does) then treats the rejected connect as established. Set `ECONNRESET` while the socket is still connecting, the same result a blocking connect returns. ## Impact Non-blocking `connect()` on an AF_RPMSG stream socket to a name nobody listens on now reports `ECONNRESET` through `SO_ERROR`. No change once a connection is established. ## Testing Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu 13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205 The commit builds sim:rpserver, sim:rpproxy, qemu-armv8a:rpserver and qemu-armv8a:rpproxy with 0 warnings. sim:rpserver + sim:rpproxy, with a test-only program on the proxy (not in this PR) that opens a non-blocking AF_RPMSG stream socket, connects to cpu "server", name "p192nolisten" (no listener), polls for POLLOUT and reads SO_ERROR: | | connect | poll | SO_ERROR | |---|---|---|---| | master | -1, EINPROGRESS (115) | 1, revents 0x18 | 0 | | this PR | -1, EINPROGRESS (115) | 1, revents 0x18 | 104 (ECONNRESET) | imx93-qsb:rpmsg is unaffected (no networking there). No regression in rpmsg: sim:rpserver/rpproxy and qemu-armv8a:rpserver/rpproxy boot and pass the fixed rpmsg cases (dump, ping, rpmsgfs; 15/15). qemu-armv8a was built with LIBC_ENVPATH and BINFMT_CHECKEXEC disabled, which current master needs for nxinit to start nsh there; unrelated to this change. -- 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]
