qemu/slirp
Gavin Grant 93a972f854 slirp: Propagate host TCP RST packet to the guest after socket disconnected
Commit 27d92ebc5e handled the case where the TCP
connection is abruptly closed via a RST packet, by checking for the ECONNRESET
errno. However it does not consider the case where the connection has been
half-closed by the host (FIN/ACK), then the host socket is disconnected. For
example, if the host application calls close() on the socket, then the
application exits.

In this case, the socket still exists due to the file descriptor in SLIRP, but
it is disconnected. recv() does not indicate an error since an orderly socket
close has previously occurred. The socket will then be stuck in FIN_WAIT_2,
until the peer sends FIN/ACK or a timeout occurs. Instead we can send a RST
to the peer and transition to the CLOSED state.

Signed-off-by: Gavin Grant <gavingrant@protonmail.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2018-10-07 19:50:48 +02:00
..
COPYRIGHT Remove the advertising clause from the slirp license 2009-01-26 19:37:41 +00:00
Makefile.objs slirp: add a fake NC-SI backend 2017-04-25 19:17:25 +08:00
arp_table.c slirp/debug: Print IP addresses in human readable form 2018-05-31 21:19:24 +02:00
bootp.c slirp: Add domainname option to slirp's DHCP server 2018-05-31 21:19:08 +02:00
bootp.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
cksum.c Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
debug.h slirp: Cleanup and basic reanimation of debug code 2009-06-29 08:52:46 -05:00
dhcpv6.c slirp, disas: Replace min/max with MIN/MAX macros 2016-12-20 23:55:19 +01:00
dhcpv6.h slirp: add in6_dhcp_multicast() 2018-01-14 18:16:13 +01:00
dnssearch.c slirp: Use DIV_ROUND_UP 2016-06-07 18:19:25 +03:00
if.c slirp: Add a special case for the NULL socket 2017-09-24 20:04:09 +02:00
if.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
ip.h slirp: removed unused code 2018-01-14 18:16:13 +01:00
ip6.h slirp: use DIV_ROUND_UP 2017-07-15 14:28:25 +02:00
ip6_icmp.c slirp: fix ipv6 timers 2018-10-02 19:08:59 +02:00
ip6_icmp.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
ip6_input.c slirp: Allow disabling IPv4 or IPv6 2016-04-01 17:51:55 +02:00
ip6_output.c slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration 2016-03-15 10:35:00 +01:00
ip_icmp.c slirp: fix ICMP handling on macOS hosts 2018-10-07 19:40:30 +02:00
ip_icmp.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
ip_input.c Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
ip_output.c Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
libslirp.h slirp: Add domainname option to slirp's DHCP server 2018-05-31 21:19:08 +02:00
main.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
mbuf.c slirp: document mbuf pointers and sizes 2018-10-07 19:40:30 +02:00
mbuf.h slirp: document mbuf pointers and sizes 2018-10-07 19:40:30 +02:00
misc.c slirp: fork_exec(): Don't close() a negative number in fork_exec() 2017-07-15 14:28:25 +02:00
misc.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
ncsi-pkt.h slirp: add a fake NC-SI backend 2017-04-25 19:17:25 +08:00
ncsi.c slirp/ncsi: add checksum support 2018-05-31 21:19:24 +02:00
ndp_table.c slirp: avoid IN6_IS_ADDR_UNSPECIFIED(), rather use in6_zero() 2018-01-14 18:16:13 +01:00
sbuf.c slirp: Handle error returns from sosendoob() 2017-07-15 14:28:25 +02:00
sbuf.h slirp: VMStatify sbuf 2017-04-29 18:44:16 +02:00
slirp.c slirp: Send window updates to guest after window was closed 2018-05-31 21:19:24 +02:00
slirp.h slirp: Add domainname option to slirp's DHCP server 2018-05-31 21:19:08 +02:00
slirp_config.h slirp: Remove obsolete backward-compatibility cruft 2016-05-16 20:58:47 +02:00
socket.c slirp: Propagate host TCP RST packet to the guest after socket disconnected 2018-10-07 19:50:48 +02:00
socket.h slirp: VMStatify socket level 2017-04-29 18:44:16 +02:00
tcp.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
tcp_input.c slirp: Fix wrong mss bug. 2017-05-27 23:34:47 +02:00
tcp_output.c slirp, disas: Replace min/max with MIN/MAX macros 2016-12-20 23:55:19 +01:00
tcp_subr.c slirp: disable Nagle in outgoing connections 2018-05-31 21:19:24 +02:00
tcp_timer.c slirp, disas: Replace min/max with MIN/MAX macros 2016-12-20 23:55:19 +01:00
tcp_timer.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
tcp_var.h slirp: VMState conversion; tcpcb 2017-04-29 18:44:16 +02:00
tcpip.h slirp, disas: Replace min/max with MIN/MAX macros 2016-12-20 23:55:19 +01:00
tftp.c slirp: tftp, copy sockaddr_size 2017-04-29 18:29:58 +02:00
tftp.h slirp: support dynamic block size for TFTP transfers 2016-12-21 00:02:15 +01:00
udp.c slirp/debug: Print IP addresses in human readable form 2018-05-20 08:25:23 +03:00
udp.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
udp6.c slirp: add in6_dhcp_multicast() 2018-01-14 18:16:13 +01:00