mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
minor patch to allow host announcements to remote subnets
This commit is contained in:
parent
a82ffca73e
commit
e264a670e9
@ -201,9 +201,6 @@ void announce_host(void)
|
||||
{
|
||||
struct work_record *work;
|
||||
|
||||
if (!d->my_interface)
|
||||
continue;
|
||||
|
||||
for (work = d->workgrouplist; work; work = work->next)
|
||||
{
|
||||
uint32 stype = work->ServerType;
|
||||
@ -228,6 +225,9 @@ void announce_host(void)
|
||||
|
||||
work->lastannounce_time = t;
|
||||
|
||||
/* when announcing to remote networks we make sure we don't
|
||||
claim to be any sort of special server, otherwise we may
|
||||
stuff up their browsing */
|
||||
if (!d->my_interface) {
|
||||
stype &= ~(SV_TYPE_POTENTIAL_BROWSER | SV_TYPE_MASTER_BROWSER |
|
||||
SV_TYPE_DOMAIN_MASTER | SV_TYPE_BACKUP_BROWSER |
|
||||
@ -263,9 +263,7 @@ void announce_host(void)
|
||||
p = p+31;
|
||||
p = skip_string(p,1);
|
||||
|
||||
if (d->my_interface)
|
||||
{
|
||||
if (AM_MASTER(work))
|
||||
if (d->my_interface && AM_MASTER(work))
|
||||
{
|
||||
SIVAL(stypep,0,work->ServerType);
|
||||
|
||||
@ -311,10 +309,8 @@ void announce_host(void)
|
||||
d->bcast_ip,*iface_ip(d->bcast_ip));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (work->needannounce)
|
||||
{
|
||||
if (work->needannounce) {
|
||||
work->needannounce = False;
|
||||
break;
|
||||
/* sorry: can't do too many announces. do some more later */
|
||||
|
@ -339,6 +339,8 @@ struct work_record *find_workgroupstruct(struct subnet_record *d,
|
||||
|
||||
if ((work = make_workgroup(name)))
|
||||
{
|
||||
work->needelection = False;
|
||||
|
||||
if (lp_preferred_master() &&
|
||||
strequal(lp_workgroup(), name) &&
|
||||
d->my_interface)
|
||||
@ -347,10 +349,6 @@ struct work_record *find_workgroupstruct(struct subnet_record *d,
|
||||
work->needelection = True;
|
||||
work->ElectionCriterion |= (1<<3);
|
||||
}
|
||||
if (!d->my_interface)
|
||||
{
|
||||
work->needelection = False;
|
||||
}
|
||||
add_workgroup(work, d);
|
||||
return(work);
|
||||
}
|
||||
|
@ -355,6 +355,10 @@ BOOL check_elections(void)
|
||||
for (d = subnetlist; d; d = d->next)
|
||||
{
|
||||
struct work_record *work;
|
||||
|
||||
/* we only want to run elections on our own interfaces */
|
||||
if (!d->my_interface) continue;
|
||||
|
||||
for (work = d->workgrouplist; work; work = work->next)
|
||||
{
|
||||
run_any_election |= work->RunningElection;
|
||||
|
Loading…
Reference in New Issue
Block a user