qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] PATCH: access samba-server on host OS with -user-net
@ 2004-08-31 10:53 Mark Jonckheere
  0 siblings, 0 replies; only message in thread
From: Mark Jonckheere @ 2004-08-31 10:53 UTC (permalink / raw)
  To: qemu-devel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-31 10:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-31 10:53 [Qemu-devel] PATCH: access samba-server on host OS with -user-net Mark Jonckheere

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).