aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-26 15:33:41 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-26 15:33:41 +0000
commit4a0d8278ca77c5e93a6594556a21ec562f8e0b10 (patch)
tree67ada9060b86f377cf9809068737d3d2c5fcad68
parentce1f4520ffcc7b835098da466db8755fc7bbd04d (diff)
Fix slirp udp source address contamination (Jason Wessel)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4259 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--slirp/udp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/slirp/udp.c b/slirp/udp.c
index c48923b0c9..0dd7da6cde 100644
--- a/slirp/udp.c
+++ b/slirp/udp.c
@@ -318,7 +318,8 @@ 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) {
+ 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(0x000000ff)) == htonl(0xff))
saddr.sin_addr.s_addr = alias_addr.s_addr;