qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix regression against commit 4259
@ 2008-04-26 21:30 Jason Wessel
  2008-04-27 22:42 ` andrzej zaborowski
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Wessel @ 2008-04-26 21:30 UTC (permalink / raw)
  To: qemu-devel

Stuart Brady found a regression based on the 4259 commit where
DNS via slirp to the special address does not work properly.

I verified that DNS to the default special address 10.0.2.3 does not
work.   When using the "special address" for DNS it must be treated as
a special case.  In the original 4259, I did not have a test case for
the loopback DNS.  The translation logic should be used in this case
as well as for any loopback directed requests.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

---
 slirp/udp.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/slirp/udp.c
+++ b/slirp/udp.c
@@ -318,11 +318,12 @@ int udp_output(struct socket *so, struct
     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 == htonl(0x7f000001) ||
+                 ((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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-28 12:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-26 21:30 [Qemu-devel] [PATCH] Fix regression against commit 4259 Jason Wessel
2008-04-27 22:42 ` andrzej zaborowski
2008-04-28 12:50   ` Jason Wessel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).