slirp: move socket pair creation in helper function
commit7f5140929bef33e833b99e02f7b8dceb7b7aa123
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 14 Nov 2018 12:36:03 +0000 (14 16:36 +0400)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 13 Jan 2019 23:40:54 +0000 (14 00:40 +0100)
tree9ce10e5ee3be92aea267d6601a2486a1d5fe5d52
parent9a50b0e0b80faf8f4e53d3f7e73144421561a7c8
slirp: move socket pair creation in helper function

Originally, the patch was fixing a bunch of issues, but Peter beat me
to it with earlier commit "slirp: fork_exec(): create and connect
child socket before fork()".

Factor out socket pair creation, to simplify the fork_exec() code.
Use the name socketpair_with_oob() since the code is actually similar
to what socketpair() would do, except that it uses TCP sockets, for
SLIRP to be able to call send with MSG_OOB (since SO_OOBINLINE is set,
this could probably be faked instead on regular unix sockets though).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
slirp/misc.c