After upleveling from samba-1.9.17p5 to samba-1.9.18.x I sometimes get the following message logged in log.nmb: "Bind failed on port 137 of socket address 0.0.0.0". This happens when the daemons are restarted at night (leaving me some time to cycle the logfiles). After poking around in the code I noticed the following changes in nmbd.c. ==========================================================> if ( isdaemon )> ClientNMB = open_socket_in(SOCK_DGRAM, port,0,0);--- < if (isdaemon) < ClientNMB = open_socket_in(SOCK_DGRAM, port,0,interpret_addr(lp_socket_add ress())); 421c347> ClientDGRAM = open_socket_in(SOCK_DGRAM,DGRAM_PORT,3,0);--- < ClientDGRAM open_socket_in(SOCK_DGRAM,DGRAM_PORT,3,interpret_addr(lp_socke t_address())); ========================================================== I seems that the old nmbd (samba-1.9.17p5) would only accept packets from the interfaces mentioned with the parameter "interfaces". But the new nmbd is willing to accept packets from all addresses. Can anyone (possibly Jeremy?) explain this change of code? BTW. The restarting of the samba daemons is a simple killing of the nmbd procs followed by a killing of running smbd procs. TIA, Rene Nieuwenhuizen Centraal Planbureau The Hague The Netherlands
R.Nieuwenhuizen@cpb.nl wrote:> > I seems that the old nmbd (samba-1.9.17p5) would only accept packets from > the interfaces mentioned with the parameter "interfaces". But the new nmbd > is willing to accept packets from all addresses. Can anyone (possibly > Jeremy?) explain this change of code? >Sure, the new nmbd opens one socket per interface, plus one socket on the broadcast interface. This is done so we can tell which interface a udp packet came in on, or whether it came in on an address not configured in the interfaces list. We can decide what to do with a packet based on the incoming interface - also, when registering a multihomed host with an NT WINS server it's important that the outgoing IP address is the correct one or the multihomed registration will fail - so we use the correct sockets for outgoing packets also. If you want to restrict the interfaces that nmbd will accept packets on then set the 'bind interfaces only' parameter to true in the [global] section of the smb.conf. Cheers, Jeremy. -- -------------------------------------------------------- Buying an operating system without source is like buying a self-assembly Space Shuttle with no instructions. --------------------------------------------------------