aboutsummaryrefslogtreecommitdiff
path: root/slirp
diff options
context:
space:
mode:
Diffstat (limited to 'slirp')
-rw-r--r--slirp/udp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/slirp/udp.c b/slirp/udp.c
index 0dd7da6cde..3f0c08b3b1 100644
--- a/slirp/udp.c
+++ b/slirp/udp.c
@@ -318,11 +318,12 @@ int udp_output(struct socket *so, struct mbuf *m,
struct sockaddr_in saddr, daddr;
saddr = *addr;
- if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr &&
- addr->sin_addr.s_addr == htonl(0x7f000001)) {
- saddr.sin_addr.s_addr = so->so_faddr.s_addr;
+ if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr) {
if ((so->so_faddr.s_addr & htonl(0x000000ff)) == htonl(0xff))
saddr.sin_addr.s_addr = alias_addr.s_addr;
+ else if (addr->sin_addr.s_addr == loopback_addr.s_addr ||
+ ((so->so_faddr.s_addr & htonl(CTL_DNS)) == htonl(CTL_DNS)))
+ saddr.sin_addr.s_addr = so->so_faddr.s_addr;
}
daddr.sin_addr = so->so_laddr;
daddr.sin_port = so->so_lport;