mirror of
https://github.com/samba-team/samba.git
synced 2025-03-20 22:50:26 +03:00
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 (This used to be commit ebaff730c9cb6d04049fd9901d46dcd758357e95)
This commit is contained in:
parent
ab0bdc6682
commit
3046a0d7c2
@ -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;
|
||||
static time_t lastrun=0;
|
||||
struct subnet_record *d;
|
||||
|
||||
if (!lastrun) lastrun = t;
|
||||
if (t < lastrun + CHECK_TIME_MST_BROWSE * 60)
|
||||
return;
|
||||
lastrun = t;
|
||||
if (!lastrun) lastrun = t;
|
||||
if (t < lastrun + CHECK_TIME_MST_BROWSE * 60)
|
||||
return;
|
||||
lastrun = t;
|
||||
|
||||
dump_workgroups();
|
||||
dump_workgroups();
|
||||
|
||||
for (d = subnetlist; d; d = d->next)
|
||||
{
|
||||
struct work_record *work;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user