diff options
author | Samba Release Account <samba-bugs@samba.org> | 1997-03-08 18:47:07 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1997-03-08 18:47:07 +0000 |
commit | ebaff730c9cb6d04049fd9901d46dcd758357e95 (patch) | |
tree | cabfca2a07f1accb1be741c1273557eb9624ae4f | |
parent | 4563d978feaed37aab78e62461026a79dbc50249 (diff) | |
download | samba-ebaff730c9cb6d04049fd9901d46dcd758357e95.tar.gz |
preferred master option will force an election every 5 minutes if the
server isn't a preferred master, and DEBUG(0,(...)) this.
reason: if the os level etc parameters aren't working properly, then
a domain master browser samba server that _ought_ to be the local master
browser as well might not.
i'll modify smb.conf.5 man page etc to reflect this change.
lkcl
-rw-r--r-- | source/nameelect.c | 59 |
1 files changed, 38 insertions, 21 deletions
diff --git a/source/nameelect.c b/source/nameelect.c index 1c4f8e63900..9a15c0b1129 100644 --- a/source/nameelect.c +++ b/source/nameelect.c @@ -56,33 +56,50 @@ extern uint16 nb_type; /* samba's NetBIOS name type */ ******************************************************************/ void check_master_browser(time_t t) { - static time_t lastrun=0; - struct subnet_record *d; - - if (!lastrun) lastrun = t; - if (t < lastrun + CHECK_TIME_MST_BROWSE * 60) - return; - lastrun = t; + static time_t lastrun=0; + struct subnet_record *d; - dump_workgroups(); + if (!lastrun) lastrun = t; + if (t < lastrun + CHECK_TIME_MST_BROWSE * 60) + return; + lastrun = t; - for (d = subnetlist; d; d = d->next) - { - struct work_record *work; + dump_workgroups(); - for (work = d->workgrouplist; work; work = work->next) + for (d = subnetlist; d; d = d->next) { - /* if we are not the browse master of a workgroup, and we can't - find a browser on the subnet, do something about it. */ + struct work_record *work; - if (!AM_MASTER(work)) - { - queue_netbios_packet(d,ClientNMB,NMB_QUERY,NAME_QUERY_MST_CHK, - work->work_group,0x1d,0,0,0,NULL,NULL, - True,False,d->bcast_ip,d->bcast_ip); - } + for (work = d->workgrouplist; work; work = work->next) + { + if (!AM_MASTER(work)) + { + if (lp_preferred_master()) + { + /* preferred master - not a master browser. force + becoming a master browser, hence the log message. + */ + + DEBUG(0,("%s preferred master for %s %s - force election\n", + timestring(), work->work_group, + inet_ntoa(d->bcast_ip))); + + browser_gone(work->work_group, d->bcast_ip); + } + else + { + /* if we are not the browse master of a workgroup, + and we can't find a browser on the subnet, do + something about it. + */ + + queue_netbios_packet(d,ClientNMB,NMB_QUERY,NAME_QUERY_MST_CHK, + work->work_group,0x1d,0,0,0,NULL,NULL, + True,False,d->bcast_ip,d->bcast_ip); + } + } + } } - } } |