qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] PATCH: access samba-server on host OS with -user-net


From: Mark Jonckheere
Subject: [Qemu-devel] PATCH: access samba-server on host OS with -user-net
Date: Tue, 31 Aug 2004 12:53:26 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020408

After switching from TUN/TAP-based to slirp-based networking, I
discovered that a windows 98 client couldn't access the samba server
on the linux host anymore.

After some debugging it became clear that UDP messages sent with a
broadcast destination address 10.0.2.255 are answered with that same
broadcast address as a source address. These answers are ignored by
windows.

The following patch corrects this:

---8<------------------------------------
--- qemu/slirp/udp.c    Tue Aug 24 23:57:12 2004
+++ qemu-patched/slirp/udp.c    Tue Aug 31 11:25:22 2004
@@ -314,6 +314,8 @@
     saddr = *addr;
     if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr)
         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 = special_addr.s_addr | htonl(CTL_ALIAS);
     daddr.sin_addr = so->so_laddr;
     daddr.sin_port = so->so_lport;

---8<------------------------------------

Groeten,
Mark.
--
:wq





reply via email to

[Prev in Thread] Current Thread [Next in Thread]