qemu-patch-raspberry4/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
..
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
cksum.c
COPYRIGHT
debug.h
dhcpv6.c
dhcpv6.h
dnssearch.c
if.c
if.h
ip.h
ip6.h
ip6_icmp.c slirp: fix ipv6 timers 2018-10-02 19:08:59 +02:00
ip6_icmp.h
ip6_input.c
ip6_output.c
ip_icmp.c slirp: fix ICMP handling on macOS hosts 2018-10-07 19:40:30 +02:00
ip_icmp.h
ip_input.c
ip_output.c
libslirp.h slirp: Add domainname option to slirp's DHCP server 2018-05-31 21:19:08 +02:00
main.h
Makefile.objs
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
misc.h
ncsi-pkt.h
ncsi.c slirp/ncsi: add checksum support 2018-05-31 21:19:24 +02:00
ndp_table.c
sbuf.c
sbuf.h
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
socket.c slirp: Propagate host TCP RST packet to the guest after socket disconnected 2018-10-07 19:50:48 +02:00
socket.h
tcp.h
tcp_input.c
tcp_output.c
tcp_subr.c slirp: disable Nagle in outgoing connections 2018-05-31 21:19:24 +02:00
tcp_timer.c
tcp_timer.h
tcp_var.h
tcpip.h
tftp.c
tftp.h
udp.c
udp.h
udp6.c