WINS.DAT and multiple registrations of the same name

Jeremy Allison jallison at
Mon Sep 21 22:32:27 GMT 1998

Luke Kenneth Casson Leighton wrote:
> if it's an ordinary registration (non-multi-homed) i think what's
> happening here is that we are not removing the "expired"  entries from
> wins.dat when the new (nowins_process_name_registration_requestn-multi-homed) registration comes in.

Well the code flow in nmbd is :

if( registration request is for name that exists AND ip of new
    reg != IP in WINS.dat ) {

  Send_wack_packet to requestor :

  Send query name to original IP in WINS.DAT

  if( original IP owner still replied and still wants
      the name )

     send registration reject packet to new requestor.


     remove old name from WINS.DAT

     add new name/IP address pair.


It's all in nmbd/nmbd_winsserver in wins_process_name_registration_request()
and wins_register_query_fail().

wins_register_query_fail() is the function that removes the
original name in the code section that goes :

---------------------------------cut here---------------------------

   * We want to just add the name, as we now know the original owner
   * didn't want it. But we can't just do that as an arbitary
   * amount of time may have taken place between the name query
   * request and this timeout/error response. So we check that
   * the name still exists and is in the same state - if so
   * we remove it and call wins_process_name_registration_request()
   * as we know it will do the right thing now.

  namerec = find_name_on_subnet(subrec, question_name, FIND_ANY_NAME);

  if( (namerec != NULL)
   && (namerec->data.source == REGISTER_NAME)
   && ip_equal(rrec->packet->ip, *namerec->data.ip) )
    remove_name_from_namelist( subrec, namerec);
    namerec = NULL;

-----------------------------end cut----------------------------------

Now if richard can instrument this section of code and see
why it is not removing the name from the namelist then
this will tell us what may be wrong in his case.



Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-technical mailing list