mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
slirp: fix guest network access with darwin host
On Darwin, connect, sendto and friends want the exact size of the sockaddr, not more (and in particular, not sizeof(struct sockaddr_storaget)) This commit adds the sockaddr_size helper to be used when passing a sockaddr size to such function, and makes use of it int sendto and connect calls. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: John Arbuckle <programmingkidx@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
8c4bf97580
commit
0d48dfedc5
4 changed files with 15 additions and 3 deletions
|
@ -413,7 +413,7 @@ int tcp_fconnect(struct socket *so, unsigned short af)
|
|||
sotranslate_out(so, &addr);
|
||||
|
||||
/* We don't care what port we get */
|
||||
ret = connect(s,(struct sockaddr *)&addr,sizeof (addr));
|
||||
ret = connect(s, (struct sockaddr *)&addr, sockaddr_size(&addr));
|
||||
|
||||
/*
|
||||
* If it's not in progress, it failed, so we just return 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue