minor fixes to the DMB<->DMB sync code. We now get the dmb name from
authorAndrew Tridgell <tridge@samba.org>
Mon, 31 Aug 1998 07:23:11 +0000 (07:23 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 31 Aug 1998 07:23:11 +0000 (07:23 +0000)
the local_master name on the unicast subnet if it is unknown.

source/nmbd/nmbd_browsesync.c

index b1fb4e631fd2043e102ff8ab273d4c46b82ae7c0..5969395ef775a552a83376336f401257cf1f3967 100644 (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)));