qemu-e2k/net
Michael Tokarev 5c1e1890bf slirp smb with modern win guests when samba is also running on host
After numerous reports that -smb (or -netdev user,smb=foo) not working
with modern windows (win7 and vista are reported as non-working), I
started digging myself.  And found that indeed it doesn't work, and
why.

The thing is that modern win tries to connect to port 445 (microsoft-ds)
first, and if that fails, it falls back to old port 139 (netbios-ssn).

slirp code in qemu only redirects port 139, it does not touch port 445.

So the prob is that if samba is also running on the host, guest will try
to communicate using port 445, and that will succed, but ofcourse guest
will not talk with our samba but with samba running on the host.

If samba is not running on the host, guest will fall back to port 139,
and will reach the redirecting rule and qemu will spawn smbd correctly.

The solution is to redirect both ports (139 and 445), and the fix is
a one-liner, adding second call to slirp_add_exec() at the end of
net/slirp.c:slirp_smb() function (provided below).

But it looks like that is not a proper fix really, since in theory
we should redirect both ports to the SAME, single samba instance,
but I'm not sure this is possible with slirp.  Well, even if two
smbd processes will be run on the same config dir, it should not
be a problem.

The one-liner (not exactly 1 since it touches previous line too) is like
this:

Signed-off-By: Michael Tokarev <mjt@tls.msk.ru>

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2014-03-12 08:13:24 +01:00
..
checksum.c
clients.h net: Adding netmap network backend 2013-12-09 13:33:19 +01:00
dump.c
eth.c
hub.c net: Rename send_queue to incoming_queue 2013-09-06 17:01:26 +02:00
hub.h
Makefile.objs net: Adding netmap network backend 2013-12-09 13:33:19 +01:00
net.c net: remove implicit peer from offload API 2014-02-25 14:31:05 +01:00
netmap.c net: Disable netmap backend when not supported 2014-02-25 11:50:17 +01:00
queue.c
slirp.c slirp smb with modern win guests when samba is also running on host 2014-03-12 08:13:24 +01:00
socket.c net: call socket_set_fast_reuse instead of setting SO_REUSEADDR 2013-10-02 19:20:31 +02:00
tap_int.h
tap-aix.c
tap-bsd.c tap: Use numbered tap/tun devices on all *BSD OS's 2013-09-06 17:01:26 +02:00
tap-haiku.c
tap-linux.c tap-linux: Get features once and use it many times 2014-01-27 15:44:06 +01:00
tap-linux.h
tap-solaris.c
tap-win32.c net: make tap offloading callbacks static 2014-02-25 11:50:17 +01:00
tap.c net: make tap offloading callbacks static 2014-02-25 11:50:17 +01:00
util.c
util.h
vde.c