From f3ae070459066e8bb878cf1f48ff53018545241d Mon Sep 17 00:00:00 2001 From: balrog Date: Sun, 27 Apr 2008 21:45:18 +0000 Subject: Treat DNS a special case among special addresses in slirp (Jason Wessel). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4267 c046a42c-6fe2-441c-8c8c-71466251a162 --- slirp/udp.c | 7 ++++--- 1 file 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; -- cgit v1.2.3