Commit 4a0d8278ca77c5e93a6594556a21ec562f8e0b10

Authored by balrog
1 parent ce1f4520

Fix slirp udp source address contamination (Jason Wessel)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4259 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 2 additions and 1 deletions
slirp/udp.c
... ... @@ -318,7 +318,8 @@ int udp_output(struct socket *so, struct mbuf *m,
318 318 struct sockaddr_in saddr, daddr;
319 319  
320 320 saddr = *addr;
321   - if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr) {
  321 + if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr &&
  322 + addr->sin_addr.s_addr == htonl(0x7f000001)) {
322 323 saddr.sin_addr.s_addr = so->so_faddr.s_addr;
323 324 if ((so->so_faddr.s_addr & htonl(0x000000ff)) == htonl(0xff))
324 325 saddr.sin_addr.s_addr = alias_addr.s_addr;
... ...