From 055e3c88e6d88bd7dee5ae9c87dc04433124f660 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 31 Aug 1998 04:19:31 +0000 Subject: set a maximum name refresh time of 20 minutes. The previous code was strictly correct, but not very practical. self names were only refreshed every 3 days. I hit a situation where the Samba WINS server was restarted after deleting wins.dat and didn't notice some remote subnets (also running Samba). I realised that the complete database wouldn't have been rebuilt for 3 days, which is way too long. In order to recover from WINS restarts we need a much shorter maximum refresh time. (This used to be commit 1d23dd0912e81ff72695bd043e8e2aee32da18a8) --- source3/nmbd/nmbd_namelistdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/nmbd/nmbd_namelistdb.c') diff --git a/source3/nmbd/nmbd_namelistdb.c b/source3/nmbd/nmbd_namelistdb.c index de5835a115..498cbcfdcf 100644 --- a/source3/nmbd/nmbd_namelistdb.c +++ b/source3/nmbd/nmbd_namelistdb.c @@ -186,7 +186,7 @@ void update_name_ttl( struct name_record *namerec, int ttl ) if( namerec->data.death_time != PERMANENT_TTL ) namerec->data.death_time = time_now + ttl; - namerec->data.refresh_time = time_now + (ttl/2); + namerec->data.refresh_time = time_now + MIN((ttl/2), MAX_REFRESH_TIME); namerec->subnet->namelist_changed = True; } /* update_name_ttl */ @@ -251,7 +251,7 @@ struct name_record *add_name_to_subnet( struct subnet_record *subrec, else namerec->data.death_time = time_now + ttl; - namerec->data.refresh_time = time_now + (ttl/2); + namerec->data.refresh_time = time_now + MIN((ttl/2), MAX_REFRESH_TIME); /* Now add the record to the name list. */ update_name_in_namelist( subrec, namerec ); -- cgit