summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/nmbd/nmbd_browsesync.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/nmbd/nmbd_browsesync.c b/source3/nmbd/nmbd_browsesync.c
index b1fb4e631f..5969395ef7 100644
--- a/source3/nmbd/nmbd_browsesync.c
+++ b/source3/nmbd/nmbd_browsesync.c
@@ -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)));