nmbd using the wrong source address upon sending Node Status requests

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Apr 24 16:00:50 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Being a LMB nmbd has to send out a node status request to the DMB to
find its real name to send as called name. This is done from the wrong
source ip address if we use 'bind interfaces only = yes' to a virtual
interface. This is needed if you want to run several LMBs on a machine
or in a cluster environment.

The node status request goes out with the main interface's IP address
as the socket used to send the UDP packet is bound to 0.0.0.0 and nmbd
will not receive this. I have not really followed why we ignore the
reply.

I can supply logs, sniffs & confs upon request.

I have a little proof of concept patch that revives the socket address
parameter for this purpose:

Index: source/nmbd/nmbd.c
===================================================================
RCS file: /space/vl/cvstree/samba/source/nmbd/nmbd.c,v
retrieving revision 1.105.2.21
diff -u -r1.105.2.21 nmbd.c
- --- source/nmbd/nmbd.c	30 Mar 2003 23:04:17 -0000	1.105.2.21
+++ source/nmbd/nmbd.c	24 Apr 2003 15:20:55 -0000
@@ -532,7 +532,7 @@
    */
 
   if ( isdaemon )
- -    ClientNMB = open_socket_in(SOCK_DGRAM, port,0,0,True);
+    ClientNMB = open_socket_in(SOCK_DGRAM, port,0,interpret_addr(lp_socket_address()),True);
   else
     ClientNMB = 0;
   
There was some discussion on irc that this might be not the right
solution as 'socket address' is now deprecated. But what is the right
one to this rather obvious bug? This *definitely* needs fixing. Why is
'socket address' deprecated in the first place?

Volker

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Key-ID D32186CF, Fingerprint available: phone +49 551 3700000

iD8DBQE+qAoeOmSXH9Mhhs8RAsfrAJ0R+jP0HqN5N4BIovO8fgpKPnm8KgCeP5UP
DRueCNJlWvp//Im5VI84XOg=
=T9mE
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list