mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
minor fixes to the DMB<->DMB sync code. We now get the dmb name from
the local_master name on the unicast subnet if it is unknown.
(This used to be commit 222b6d90e0
)
This commit is contained in:
parent
9076947b93
commit
5e20600e54
@ -585,21 +585,26 @@ void sync_all_dmbs(time_t t)
|
||||
|
||||
/* count how many syncs we might need to do */
|
||||
for (work=unicast_subnet->workgrouplist; work; work = work->next) {
|
||||
if (strcmp(global_myworkgroup, work->work_group) &&
|
||||
!ip_equal(work->dmb_addr, ipzero)) {
|
||||
if (strcmp(global_myworkgroup, work->work_group)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
/* sync with a probability of 1/count */
|
||||
for (work=unicast_subnet->workgrouplist; work; work = work->next) {
|
||||
if (strcmp(global_myworkgroup, work->work_group) &&
|
||||
!ip_equal(work->dmb_addr, ipzero)) {
|
||||
|
||||
if (strcmp(global_myworkgroup, work->work_group)) {
|
||||
if (((unsigned)random()) % count != 0) continue;
|
||||
|
||||
lastrun = t;
|
||||
|
||||
if (!work->dmb_name.name[0]) {
|
||||
/* we don't know the DMB - assume it is
|
||||
the same as the unicast local master */
|
||||
make_nmb_name(&work->dmb_name,
|
||||
work->local_master_browser_name,
|
||||
0x20, scope);
|
||||
}
|
||||
|
||||
DEBUG(3,("initiating DMB<->DMB sync with %s(%s)\n",
|
||||
work->dmb_name.name,
|
||||
inet_ntoa(work->dmb_addr)));
|
||||
|
Loading…
Reference in New Issue
Block a user