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> |
||
---|---|---|
.. | ||
arp_table.c | ||
bootp.c | ||
bootp.h | ||
cksum.c | ||
COPYRIGHT | ||
debug.h | ||
dhcpv6.c | ||
dhcpv6.h | ||
dnssearch.c | ||
if.c | ||
if.h | ||
ip.h | ||
ip6.h | ||
ip6_icmp.c | ||
ip6_icmp.h | ||
ip6_input.c | ||
ip6_output.c | ||
ip_icmp.c | ||
ip_icmp.h | ||
ip_input.c | ||
ip_output.c | ||
libslirp.h | ||
main.h | ||
Makefile.objs | ||
mbuf.c | ||
mbuf.h | ||
misc.c | ||
misc.h | ||
ncsi-pkt.h | ||
ncsi.c | ||
ndp_table.c | ||
sbuf.c | ||
sbuf.h | ||
slirp.c | ||
slirp.h | ||
slirp_config.h | ||
socket.c | ||
socket.h | ||
tcp.h | ||
tcp_input.c | ||
tcp_output.c | ||
tcp_subr.c | ||
tcp_timer.c | ||
tcp_timer.h | ||
tcp_var.h | ||
tcpip.h | ||
tftp.c | ||
tftp.h | ||
udp.c | ||
udp.h | ||
udp6.c |