qemu-e2k/slirp
Peter Maydell 5c75f3adbb slirp: fork_exec(): create and connect child socket before fork()
Currently fork_exec() fork()s, and then creates and connects the
child socket which it uses for communication with the parent in
the child process. This is awkward because the child has no
mechanism to report failure back to the parent, which might end
up blocked forever in accept(). The child code also has an issue
pointed out by Coverity (CID 1005727), where if the qemu_socket()
call fails it will pass -1 as a file descriptor to connect().

Fix these issues by moving the creation of the child's end of
the socket to before the fork(), where we are in a position to
handle a possible failure.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2018-11-10 15:07:53 +01:00
..
arp_table.c slirp/debug: Print IP addresses in human readable form 2018-05-31 21:19:24 +02:00
bootp.c slirp: Implement RFC2132 TFTP server name 2018-10-21 21:24:55 +02:00
bootp.h slirp: Implement RFC2132 TFTP server name 2018-10-21 21:24:55 +02:00
cksum.c
COPYRIGHT
debug.h
dhcpv6.c
dhcpv6.h slirp: add in6_dhcp_multicast() 2018-01-14 18:16:13 +01:00
dnssearch.c
if.c slirp: Add a special case for the NULL socket 2017-09-24 20:04:09 +02:00
if.h
ip6_icmp.c qemu-timer: avoid checkpoints for virtual clock timers in external subsystems 2018-10-19 13:44:03 +02:00
ip6_icmp.h
ip6_input.c
ip6_output.c
ip6.h
ip_icmp.c slirp: Remove code that handles socreate() failure 2018-11-10 15:07:53 +01:00
ip_icmp.h
ip_input.c
ip_output.c
ip.h slirp: removed unused code 2018-01-14 18:16:13 +01:00
libslirp.h slirp: Implement RFC2132 TFTP server name 2018-10-21 21:24:55 +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 slirp: fork_exec(): create and connect child socket before fork() 2018-11-10 15:07:53 +01:00
misc.h
ncsi-pkt.h
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_config.h
slirp.c slirp: Remove code that handles socreate() failure 2018-11-10 15:07:53 +01:00
slirp.h slirp: Implement RFC2132 TFTP server name 2018-10-21 21:24:55 +02:00
socket.c slirp: Remove code that handles socreate() failure 2018-11-10 15:07:53 +01:00
socket.h
tcp_input.c slirp: Remove code that handles socreate() failure 2018-11-10 15:07:53 +01:00
tcp_output.c
tcp_subr.c slirp: Remove code that handles socreate() failure 2018-11-10 15:07:53 +01:00
tcp_timer.c
tcp_timer.h
tcp_var.h
tcp.h
tcpip.h
tftp.c
tftp.h
udp6.c slirp: Remove code that handles socreate() failure 2018-11-10 15:07:53 +01:00
udp.c slirp: Remove code that handles socreate() failure 2018-11-10 15:07:53 +01:00
udp.h