qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] slirp: fix ipv6 guest network access with windows host


From: Bo Hu
Subject: [Qemu-devel] slirp: fix ipv6 guest network access with windows host
Date: Wed, 2 Nov 2016 16:02:29 -0700

Hello qemu developers,

    This patch is from android emulator (which is based on qemu2.2) and I
hope this patch is
also useful to upstream qemu as well.

bo




>From 021eac8c593a34a6a5e106d187a8e1fd22a1522f Mon Sep 17 00:00:00 2001
From: bohu <address@hidden>
Date: Wed, 2 Nov 2016 15:56:26 -0700
Subject: [PATCH] slirp: fix ipv6 guest network access with windows host

In tcp_input function, local sockaddr_storage variables lhost
and fhost are used without being cleared to zero; and consequently
tcp connect call fails on windows because there is some random data
in those variables (windows complains with WSAEADDRNOTAVAIL);

This CL calls memset to clear those two variables so that the address
passed to connect does not have random data in it.

Signed-off-by: Bo Hu <address@hidden>
---
 slirp/tcp_input.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c
index c5063a9..9a79a16 100644
--- a/slirp/tcp_input.c
+++ b/slirp/tcp_input.c
@@ -234,6 +234,8 @@ tcp_input(struct mbuf *m, int iphlen, struct socket
*inso, unsigned short af)
  struct sockaddr_in6 *lhost6, *fhost6;
     struct ex_list *ex_ptr;
     Slirp *slirp;
+    memset(&lhost, 0, sizeof(lhost);
+    memset(&fhost, 0, sizeof(fhost);

  DEBUG_CALL("tcp_input");
  DEBUG_ARGS((dfd, " m = %p  iphlen = %2d  inso = %p\n",
-- 
2.8.0.rc3.226.g39d4020


reply via email to

[Prev in Thread] Current Thread [Next in Thread]