summaryrefslogtreecommitdiffstats
path: root/slirp/tcp_subr.c
diff options
context:
space:
mode:
authorGuillaume Subiron <maethor@subiron.org>2015-12-19 22:25:03 +0100
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:31:26 -0600
commit0e46f2bd7e79f7052286070e040fd40116502288 (patch)
treed40f4e9756259ade6f4bf29b0d8c4396e0568d05 /slirp/tcp_subr.c
parentb80db098515c4e66b59c2b8f02a3807bdc6c36e6 (diff)
downloadhqemu-0e46f2bd7e79f7052286070e040fd40116502288.zip
hqemu-0e46f2bd7e79f7052286070e040fd40116502288.tar.gz
slirp: Adding family argument to tcp_fconnect()
This patch simply adds a unsigned short family argument to remove the hardcoded "AF_INET" in the call of qemu_socket(). This prepares for IPv6 support. Signed-off-by: Guillaume Subiron <maethor@subiron.org> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'slirp/tcp_subr.c')
-rw-r--r--slirp/tcp_subr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index 76c716f..36e3256 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -324,14 +324,15 @@ tcp_sockclosed(struct tcpcb *tp)
* nonblocking. Connect returns after the SYN is sent, and does
* not wait for ACK+SYN.
*/
-int tcp_fconnect(struct socket *so)
+int tcp_fconnect(struct socket *so, unsigned short af)
{
int ret=0;
DEBUG_CALL("tcp_fconnect");
DEBUG_ARG("so = %p", so);
- if( (ret = so->s = qemu_socket(AF_INET,SOCK_STREAM,0)) >= 0) {
+ ret = so->s = qemu_socket(af, SOCK_STREAM, 0);
+ if (ret >= 0) {
int opt, s=so->s;
struct sockaddr_storage addr;
OpenPOWER on IntegriCloud