Hello, Bo Hu, on Wed 02 Nov 2016 16:02:29 -0700, wrote: > 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.
Indeed, even if normally we fill all required fields, it's probably better to memset the whole structure. > From 021eac8c593a34a6a5e106d187a8e1fd22a1522f Mon Sep 17 00:00:00 2001 > From: bohu <[1]b...@google.com> > 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 <[2]b...@google.com> > + memset(&lhost, 0, sizeof(lhost); > + memset(&fhost, 0, sizeof(fhost); There is just a typo: missing closing parenthesis... But apart from that, Reviewed-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Samuel