[PATCH] fix bug in nmbd

Stefan (metze) Metzmacher metze at metzemix.de
Fri Nov 15 15:33:02 GMT 2002


Sorry there was a typo in the patch...:-(
( namerec->data.num_addrs -> namerec->data.num_ips )

here's the working patch.

metze

At 15:41 15.11.2002 +0100, Stefan (metze) Metzmacher wrote:
>Hi,
>
>here's a patch that prevent nmbd from releasing a DOMAIN<1c> name if there 
>are more than one address, now we only remove the ip addr from the name 
>record, so that other domain controller can be found via wins :-).
>
>BTW: there's a big patch following the next days, witch makes wrepld 
>working between 2 or more samba's. And make the wins database plugable 
>with 'winsdb backend = tdb' by default.


metze
-----------------------------------------------------------------------------
Stefan "metze" Metzmacher <metze at metzemix.de>
-------------- next part --------------
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=.#* HEAD/source/nmbd/nmbd_winsserver.c HEAD-fix/source/nmbd/nmbd_winsserver.c
--- HEAD/source/nmbd/nmbd_winsserver.c	Fri Oct  4 08:06:22 2002
+++ HEAD-fix/source/nmbd/nmbd_winsserver.c	Fri Nov 15 15:15:45 2002
@@ -1635,8 +1635,24 @@ release name %s as this record is not an
            nmb_namestr(question) ));
     send_wins_name_release_response(NAM_ERR, p);
     return;
-  }    
-
+  }
+     
+  /* check if the record is a 0x1c group 
+   * and has more then one ip's
+   * remove only this address
+   *
+   */
+  if(releasing_group_name && 
+  	(question->name_type == 0x1c) && 
+  	(namerec->data.num_ips > 1))
+  {
+    remove_ip_from_name_record(namerec, from_ip);
+    DEBUG(3,("wins_process_name_release_request: Remove IP %s from NAME: %s\n",
+           inet_ntoa(from_ip),nmb_namestr(question)));
+    send_wins_name_release_response(0, p);
+    return;
+  }
+  
   /* 
    * Send a release response.
    * Flag the name as released and update the ttl


More information about the samba-technical mailing list