diff options
Diffstat (limited to 'src/socket.c')
-rw-r--r-- | src/socket.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c index 2f20028..bc6ee47 100644 --- a/src/socket.c +++ b/src/socket.c @@ -846,6 +846,9 @@ int sotranslate_out(struct socket *so, struct sockaddr_storage *addr) } else { sin->sin_addr = loopback_addr; } + } else if (!slirp->disable_host_loopback && so->so_faddr.s_addr == 0xffffffff) { + /* Receive broadcast as well */ + sin->sin_addr = loopback_addr; } break; case AF_INET6: @@ -865,6 +868,9 @@ int sotranslate_out(struct socket *so, struct sockaddr_storage *addr) } else { sin6->sin6_addr = in6addr_loopback; } + } else if (!slirp->disable_host_loopback + && in6_equal(&so->so_faddr6, &(struct in6_addr) ALLNODES_MULTICAST)) { + sin6->sin6_addr = in6addr_loopback; } break; |