From 64c37789b06cce4426abc778092583b34b6b6d2a Mon Sep 17 00:00:00 2001 From: balrog Date: Sat, 26 Apr 2008 15:33:41 +0000 Subject: [PATCH] Fix slirp udp source address contamination (Jason Wessel) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4259 c046a42c-6fe2-441c-8c8c-71466251a162 --- slirp/udp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/slirp/udp.c b/slirp/udp.c index c48923b..0dd7da6 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; -- 2.7.4