From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C26Ly-00039j-TE for qemu-devel@nongnu.org; Tue, 31 Aug 2004 06:59:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C26Lx-00039Q-WE for qemu-devel@nongnu.org; Tue, 31 Aug 2004 06:59:06 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C26Lx-00039N-L0 for qemu-devel@nongnu.org; Tue, 31 Aug 2004 06:59:05 -0400 Received: from [195.238.3.233] (helo=outmx010.isp.belgacom.be) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1C26H3-0007LN-7j for qemu-devel@nongnu.org; Tue, 31 Aug 2004 06:54:01 -0400 Received: from outmx010.isp.belgacom.be (localhost [127.0.0.1]) by outmx010.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id i7VArsY3012273 for ; Tue, 31 Aug 2004 12:53:54 +0200 (envelope-from ) Received: from easynet.be (15.67-136-217.adsl.skynet.be [217.136.67.15]) by outmx010.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id i7VArmD6012229 for ; Tue, 31 Aug 2004 12:53:48 +0200 (envelope-from ) Message-ID: <413458A6.6050607@easynet.be> Date: Tue, 31 Aug 2004 12:53:26 +0200 From: Mark Jonckheere MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] PATCH: access samba-server on host OS with -user-net Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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