Fix slirp udp source address contamination (Jason Wessel)
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 26 Apr 2008 15:33:41 +0000 (15:33 +0000)
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 26 Apr 2008 15:33:41 +0000 (15:33 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4259 c046a42c-6fe2-441c-8c8c-71466251a162

slirp/udp.c

index c48923b..0dd7da6 100644 (file)
@@ -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;