This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 348f0df0d3d net/vsock: Fail connect() with ECONNREFUSED when the peer 
resets it.
348f0df0d3d is described below

commit 348f0df0d3d8c0b48f3d5d546861bd5bd01b0fb0
Author: raiden00pl <[email protected]>
AuthorDate: Thu Nov 19 13:05:30 2026 +0100

    net/vsock: Fail connect() with ECONNREFUSED when the peer resets it.
    
    A RST reply to a connection request means that no socket listens on
    the destination port, but connect() failed with ECONNRESET. POSIX
    connect(): "[ECONNREFUSED] The target address was not listening for
    connections or refused the connection request."
    
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: raiden00pl <[email protected]>
---
 net/vsock/vsock_sockif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/vsock/vsock_sockif.c b/net/vsock/vsock_sockif.c
index bf60bd5c24a..14bafb34193 100644
--- a/net/vsock/vsock_sockif.c
+++ b/net/vsock/vsock_sockif.c
@@ -1148,7 +1148,7 @@ static int vsock_recv_connecting(FAR struct vsock_conn_s 
*conn,
         return 0;
       case VIRTIO_VSOCK_OP_RST:
         vrterr("conn=%p, VSOCK_RST\n", conn);
-        ret = -ECONNRESET;
+        ret = -ECONNREFUSED;
         break;
       default:
         vrterr("conn=%p, VSOCK_ERROR, op=%u\n", conn, hdr->op);

Reply via email to