aboutsummaryrefslogtreecommitdiff
path: root/slirp/udp.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-27 21:45:18 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-27 21:45:18 +0000
commitf3ae070459066e8bb878cf1f48ff53018545241d (patch)
tree54966198c4f3ad4120cd3215808540bfce7dd71e /slirp/udp.c
parent4fc5d0717682386fa7b28fff031f840fb7c8f489 (diff)
downloadqemu-arm-f3ae070459066e8bb878cf1f48ff53018545241d.tar.gz
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
Diffstat (limited to 'slirp/udp.c')
-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;