nmbd broadcast bindable ( samba on win2k(!))

Magnus Naeslund(f) mag at fbab.net
Mon Sep 24 17:16:02 GMT 2001

Hello, could we make nmbd broadcast stuff bindable via a config option?

I'm doing a pretty weird thing, i'm running nmbd on win2k (in cygwin), just
to get browsing to work across subnets.
The reason why is simple :)
I'm not allowed to change operating system to something else than win2k, and
i can't add another box (too expensive because it's a GBit network
(box+card+port = mucho dineros).

I have two subnets:  = 100mbit, is the domain controller
(samba on linux).  = 1gbit,<-> is the

So i just aliased the network card to add a so we have a nice,
fresh IP for our little nmbd to bind to.

Everything works, except that the nmbd brodcast stuff tries to bind to <any>
addr, failing miserably ofcourse -both the and are
taken by win2k itself.

Well i just did a quickfix, binding the ip:s to, and everything
works like a charm (see quickfix attached :)).

Some other troubles compiling in cygwin:

1) File locking doesn't work (i enabled --with-spinlocks + disabled the
check :)).
2) tdb spews errors from time to time ( tdb_oob len -3880 beyond eof,
tdb_free: left read failed) could be because of 1).
3) Some other small compile/link issues regarding initgroups and friends,
and nanosleep.

I didn't even try to compile smbd or other stuff.

Funny that it works, but i'd like to bind that stuff via a config option,
please ! :)


 Programmer/Networker [|] Magnus Naeslund
 PGP Key: http://www.genline.nu/mag_pgp.txt

--- nmbd/nmbd.c~        Tue Sep 25 01:44:02 2001
+++ nmbd/nmbd.c Tue Sep 25 01:49:50 2001
@@ -522,12 +522,14 @@
      now deprecated.

+  uint32 bindip = inet_addr("");
   if ( isdaemon )
-    ClientNMB = open_socket_in(SOCK_DGRAM, port,0,0,True);
+    ClientNMB = open_socket_in(SOCK_DGRAM, port,0,bindip,True);
     ClientNMB = 0;

-  ClientDGRAM = open_socket_in(SOCK_DGRAM,DGRAM_PORT,3,0,True);
+  ClientDGRAM = open_socket_in(SOCK_DGRAM,DGRAM_PORT,3,bindip,True);

More information about the samba-technical mailing list