bug in nmbd_nameregiste still there (all versions; tng & stable 2.0.x)

Stephan Lauffer lauffer at ph-freiburg.de
Thu May 11 12:39:03 GMT 2000


Hi all!

Some weeks ago i posted a bugreport here. I´m really no good c-pogrammer, so
it would be nice, if someone other could fix this problem.
It´s really simple to fix... just fix a simple "for loop" or something like this. ;)
And the bug is really nasty - browsing fails, dmb sucks down...

Problem:
nmbd_nameregister is trying to register all ip-addresses listed in smb.conf by
'interfaces ='
In some cases you´ve to add the localhost to this list, too (if you would change
password...).
Ok, can you see the problem? No?
Then let´s go on!
If samba is a dmb, pdc or something like this and has got to register
his name to an wins-server, the register would be rejected, because die localhost
could not be registered by an other host as the localhost himself... (the samba-server
is NOT the localhost for a wins-server or any other client in the worl!)

Look:
---
[2000/02/22 17:19:10, 0] nmbd/nmbd_packets.c:send_netbios_packet(173)
  send_netbios_packet: send_packet() to IP 193.197.133.9 port 137 failed
[2000/02/22 17:19:10, 0] nmbd/nmbd_nameregister.c:multihomed_register_name(312)
  multihomed_register_name: Failed to send packet trying to register name MAIL1<00> IP 127.0.0.1
[2000/02/22 17:19:10, 0] libsmb/nmblib.c:send_udp(755)
  Packet send failed to 193.197.133.9(137) ERRNO=Invalid argument
[2000/02/22 17:19:10, 0] nmbd/nmbd_packets.c:send_netbios_packet(173)
  send_netbios_packet: send_packet() to IP 193.197.133.9 port 137 failed
[2000/02/22 17:19:10, 0] nmbd/nmbd_nameregister.c:multihomed_register_name(312)
  multihomed_register_name: Failed to send packet trying to register name LINUX-AG<00> IP 127.0.0.1
---    
(there are some more errors... anyway...)

Ok, what will happen then? There´s no DMB, samba couldn´t sync the browsinglist with the
LMBs... the complete browsing sucks down!!!
The onyl workaround is do "disable" the passwort-change while delete the localhost from
the interface-list.

Ok, my english is bad, my c-knowledge, too. But the problem to fix must be easy:
I´m thinking, it´s about line 265... let´s have a look...
--- nmbd_nameregister.c - about line 265 ----
  /* Now try and register the name, num_ips times. On the last time use
       the given success and fail functions. */

   for( i = 0; i < num_ips; i++)
   {
      if(queue_register_multihomed_name( unicast_subnet,
          register_name_response,
          register_name_timeout_response,
          (i == num_ips - 1) ? success_fn : NULL,
          (i == num_ips - 1) ? fail_fn : NULL,
          (i == num_ips - 1) ? userdata : NULL,
          nmbname,
          nb_flags,
          ip_list[i]) == NULL)
      {
     DEBUG(0,("multihomed_register_name: Failed to send packet trying to \
register name %s IP %s\n", nmb_namestr(nmbname), inet_ntoa(ip_list[i]) ));
     free((char *)ip_list);
     return True;
   }
----------
could it be, that ip_list[i] contains the ips from 'interfaces = ...'? So if it´s so,
something like this should work "if (ip_list[i] == "127.0.0.1") { next }".

Please - I´m sure, it´s easy to fix this bug - it tooks less then 10 minutes for
a good prgrammer to solve the problem, so it would nice to help me out.
In special cases i can offer a root-login to a test-machine in our network. So it
is no problem to check out the patch in a bigger enviroment.

Liebe Gruesse,
Stephan Lauffer

[ Freiburg - Germany		 				 ]
[ Tel.: 0761 - 682 459                    Mobil: 0172 - 7145 197 ]



More information about the samba-ntdom mailing list