Skip to content

net/vsock: Fail connect() with ECONNREFUSED when the peer resets it - #22049

Open
raiden00pl wants to merge 1 commit into
apache:masterfrom
raiden00pl:vsock-connect-refused
Open

raiden00pl wants to merge 1 commit into
apache:masterfrom
raiden00pl:vsock-connect-refused

Conversation

@raiden00pl

Copy link
Copy Markdown
Member

Summary

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."

Impact

vsock connect() to a port with no listener now fails with ECONNREFUSED
instead of ECONNRESET. Nothing else changes.

Testing

qemu-armv8a with vhost-vsock-device: connect() from NuttX to a host port
with no listener fails with ECONNREFUSED (before: ECONNRESET); stream
echo, flow control, EOF and host-side refused connect still pass.

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 <raiden00@railab.me>
@github-actions github-actions Bot added Area: Networking Effects networking subsystem Size: XS The size of the change in this PR is very small labels Nov 19, 2026
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Networking Effects networking subsystem Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants