diff options
author | balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-04-27 21:45:18 +0000 |
---|---|---|
committer | balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-04-27 21:45:18 +0000 |
commit | 56c17e38e8454ac2df9c281140bcbafd3b8902bf (patch) | |
tree | 54966198c4f3ad4120cd3215808540bfce7dd71e /slirp/udp.c | |
parent | b5e575c3b5fe488d2755106c2822e33ac59fcfe2 (diff) | |
download | qemu-56c17e38e8454ac2df9c281140bcbafd3b8902bf.tar.gz qemu-56c17e38e8454ac2df9c281140bcbafd3b8902bf.tar.bz2 qemu-56c17e38e8454ac2df9c281140bcbafd3b8902bf.zip |
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.c | 7 |
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; |