aboutsummaryrefslogtreecommitdiff
path: root/slirp/ip_icmp.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-04-28 18:53:08 +0200
committerPeter Maydell <peter.maydell@linaro.org>2016-04-28 18:12:08 +0100
commit0d48dfedc5c2beb418ad4c08b78de14e794bb199 (patch)
treebd061e316c485320611cf0d3f1c2f34e1a302bce /slirp/ip_icmp.c
parent8c4bf97580a7556e3e61b7bc41dedb5958f0b2f9 (diff)
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>
Diffstat (limited to 'slirp/ip_icmp.c')
-rw-r--r--slirp/ip_icmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/slirp/ip_icmp.c b/slirp/ip_icmp.c
index 590dada0aa..5ffc7a683d 100644
--- a/slirp/ip_icmp.c
+++ b/slirp/ip_icmp.c
@@ -186,7 +186,7 @@ icmp_input(struct mbuf *m, int hlen)
sotranslate_out(so, &addr);
if(sendto(so->s, icmp_ping_msg, strlen(icmp_ping_msg), 0,
- (struct sockaddr *)&addr, sizeof(addr)) == -1) {
+ (struct sockaddr *)&addr, sockaddr_size(&addr)) == -1) {
DEBUG_MISC((dfd,"icmp_input udp sendto tx errno = %d-%s\n",
errno,strerror(errno)));
icmp_send_error(m, ICMP_UNREACH, ICMP_UNREACH_NET, 0, strerror(errno));