nameannounce.c: Made sure recurse flag set correctly.
[samba.git] / source3 / nmbsync.c
index dd1b8bac0da53ea382d36f8ce9f4a75076c24992..7c23c64a96ad478afe54551d76b03f117dd1a4ab 100644 (file)
@@ -2,7 +2,7 @@
    Unix SMB/Netbios implementation.
    Version 1.9.
    NBT netbios routines to synchronise browse lists
-   Copyright (C) Andrew Tridgell 1994-1995
+   Copyright (C) Andrew Tridgell 1994-1997
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -112,10 +112,7 @@ static BOOL add_info(struct subnet_record *d, struct work_record *work, int serv
                  /* creates workgroup on remote subnet */
                  if ((w = find_workgroupstruct(d,sname,True)))
                    {
-                     if (d->my_interface)
-                       {
-                         announce_request(w, d->bcast_ip);
-                       }
+                     announce_request(w, d->bcast_ip);
                    }
                }
              
@@ -139,9 +136,17 @@ static BOOL add_info(struct subnet_record *d, struct work_record *work, int serv
   do a NetServerEnum and update our server and workgroup databases.
   ******************************************************************/
 void sync_browse_lists(struct subnet_record *d, struct work_record *work,
-               char *name, int nm_type, struct in_addr ip)
+               char *name, int nm_type, struct in_addr ip, BOOL local)
 {
-  if (!d || !work || !AM_MASTER(work)) return;
+  uint32 local_type = local ? SV_TYPE_LOCAL_LIST_ONLY : 0;
+
+  if (!d || !work ) return;
+
+  if(d != wins_subnet) {
+      DEBUG(0,
+        ("sync_browse_lists: ERROR sync requested on non-WINS subnet.\n"));
+      return;
+  }
 
   pid = getpid();
   uid = getuid();
@@ -172,8 +177,9 @@ void sync_browse_lists(struct subnet_record *d, struct work_record *work,
     {
       if (cli_send_login(NULL,NULL,True,True))
        {
-         add_info(d, work, SV_TYPE_DOMAIN_ENUM);
-         add_info(d, work, SV_TYPE_ALL&~SV_TYPE_DOMAIN_ENUM);
+         add_info(d, work, local_type|SV_TYPE_DOMAIN_ENUM);
+         add_info(d, work, local_type|(SV_TYPE_ALL&
+                      ~(SV_TYPE_DOMAIN_ENUM|SV_TYPE_LOCAL_LIST_ONLY)));
        }
       
       close_sockets();