1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +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 commit is contained in:
Andrew Tridgell -
parent 0a5718b0ae
commit 222b6d90e0

View File

@ -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)));