[Samba] Samba 3.0.3/4 - WINS server expires names after 2 hours

Jeremy Allison jra at samba.org
Tue Jun 29 00:40:15 GMT 2004


On Thu, Jun 24, 2004 at 04:25:52PM +0200, Guillaume Millet wrote:
> Hello,
> 
> I had the same problem.
> I've found a workaround by patching the code in "nmbd/nmbd_namelistdb.c":
> 
> /*******************************************************************
>  Expires old names in all subnet namelists.
> ******************************************************************/
> 
> void expire_names(time_t t)
> {
>        struct subnet_record *subrec;
> 
>        for( subrec = FIRST_SUBNET; subrec; subrec = 
>        NEXT_SUBNET_INCLUDING_UNICAST(subrec) ) {
>                expire_names_on_subnet( subrec, t );
>        }
> 
>        expire_names_on_subnet( wins_server_subnet, t ); /* ADD THIS LINE 
>        FOR REMOVING EXPIRED NAME FROM WINS TABLE */
> }
> 
> I dont know if it's the correct things to do, but it works fine for me 
> with my configuration (PDC+LDAP+WINS with Samba 3.0.4 on MDK 9.2)
> If a real Samba develloper can have a quick look to this to make a real 
> correction for next release.

Ok, I've looked at this in the current Samba 3.0.5preXX code (SVN) and
here is the fix I think should work. It forced DNS and DNSFAIL names to
be removed from the WINS db immediately their timeout persiod expires and
not to go into the "tombstoned" state (where they would hang around for
another day).

Let me know if this fixes the problem for you.

Thanks,

	Jeremy.
-------------- next part --------------
Index: nmbd/nmbd_winsserver.c
===================================================================
--- nmbd/nmbd_winsserver.c	(revision 1287)
+++ nmbd/nmbd_winsserver.c	(working copy)
@@ -1727,11 +1727,16 @@
 		     && (namerec->data.death_time < t) ) {
 
 			if( namerec->data.source == SELF_NAME ) {
-				DEBUG( 3, ( "expire_names_on_subnet: Subnet %s not expiring SELF name %s\n", 
+				DEBUG( 3, ( "initiate_wins_processing: Subnet %s not expiring SELF name %s\n", 
 				           wins_server_subnet->subnet_name, nmb_namestr(&namerec->name) ) );
 				namerec->data.death_time += 300;
 				namerec->subnet->namelist_changed = True;
 				continue;
+			} else if (namerec->data.source == DNS_NAME || namerec->data.source == DNSFAIL_NAME) {
+				DEBUG(3,("initiate_wins_processing: deleting timed out DNS name %s\n",
+						nmb_namestr(&namerec->name)));
+				remove_name_from_namelist( wins_server_subnet, namerec );
+				break;
 			}
 
 			/* handle records, samba is the wins owner */


More information about the samba mailing list