mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 20:33:54 -06:00
slirp: handle deferred ECONNREFUSED on non-blocking TCP sockets
slirp currently only handles ECONNREFUSED in the case where connect() returns immediately with that error; since we use non-blocking sockets, most of the time we won't receive the error until we later try to read from the socket. Ensure that we deliver the appropriate RST to the guest in this case. Signed-off-by: Steven Luo <steven+qemu@steven676.net> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
parent
27d92ebc5e
commit
6625d83a6e
2 changed files with 7 additions and 1 deletions
|
@ -188,7 +188,7 @@ soread(struct socket *so)
|
|||
DEBUG_MISC((dfd, " --- soread() disconnected, nn = %d, errno = %d-%s\n", nn, errno,strerror(errno)));
|
||||
sofcantrcvmore(so);
|
||||
|
||||
if (err == ECONNRESET
|
||||
if (err == ECONNRESET || err == ECONNREFUSED
|
||||
|| err == ENOTCONN || err == EPIPE) {
|
||||
tcp_drop(sototcpcb(so), err);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue