summaryrefslogtreecommitdiff
path: root/source3/nmbd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-08-30 09:50:45 +0000
committerAndrew Tridgell <tridge@samba.org>1998-08-30 09:50:45 +0000
commitf04d5b6b11235cc9ade0d65063dd60ad2184ee96 (patch)
treecb28225af15f8bbcc36d47670cfb84c2b2216055 /source3/nmbd
parent179e8c66f121e01b5e69ad8b1c39f8a1a1e45814 (diff)
downloadsamba-f04d5b6b11235cc9ade0d65063dd60ad2184ee96.tar.gz
samba-f04d5b6b11235cc9ade0d65063dd60ad2184ee96.tar.bz2
samba-f04d5b6b11235cc9ade0d65063dd60ad2184ee96.zip
we we have successfully done a query on *<1b> from a wins server and
then obtained a node status response we need to remember the server name of the master browser so that other browse clients asking us for a workgroup list will get a entry for the master of that workgroup. (This used to be commit 601f995ffbfa0ee477ea628d92b9660d6bdd8cbc)
Diffstat (limited to 'source3/nmbd')
-rw-r--r--source3/nmbd/nmbd_browsesync.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/source3/nmbd/nmbd_browsesync.c b/source3/nmbd/nmbd_browsesync.c
index bc0cf43f7c..ac2cb5b71e 100644
--- a/source3/nmbd/nmbd_browsesync.c
+++ b/source3/nmbd/nmbd_browsesync.c
@@ -496,6 +496,9 @@ static void get_domain_master_name_node_status_success(struct subnet_record *sub
struct in_addr from_ip)
{
struct work_record *work;
+ fstring server_name;
+
+ server_name[0] = 0;
DEBUG(3,("get_domain_master_name_node_status_success: Success in node status from ip %s\n",
inet_ntoa(from_ip) ));
@@ -525,11 +528,19 @@ static void get_domain_master_name_node_status_success(struct subnet_record *sub
p += 18;
+ if(!(nb_flags & NB_GROUP) && (name_type == 0x00) &&
+ server_name[0] == 0) {
+ /* this is almost certainly the server netbios name */
+ fstrcpy(server_name, qname);
+ continue;
+ }
+
if(!(nb_flags & NB_GROUP) && (name_type == 0x1b))
{
- DEBUG(5,("get_domain_master_name_node_status_success: IP %s is a domain \
-master browser for workgroup %s. Adding this name.\n", inet_ntoa(from_ip), qname ));
+ DEBUG(5,("get_domain_master_name_node_status_success: %s(%s) is a domain \
+master browser for workgroup %s. Adding this name.\n",
+ server_name, inet_ntoa(from_ip), qname ));
/*
* If we don't already know about this workgroup, add it
@@ -537,11 +548,18 @@ master browser for workgroup %s. Adding this name.\n", inet_ntoa(from_ip), qname
*/
if((work = find_workgroup_on_subnet( subrec, qname)) == NULL)
{
- /*
- * Add it - with an hour in the cache.
- */
- if((work = create_workgroup_on_subnet(subrec, qname, 60*60))==NULL)
- return;
+ struct nmb_name nmbname;
+ /*
+ * Add it - with an hour in the cache.
+ */
+ if(!(work= create_workgroup_on_subnet(subrec, qname, 60*60)))
+ return;
+
+ /* remember who the master is */
+ fstrcpy(work->local_master_browser_name, server_name);
+ make_nmb_name(&nmbname, server_name, 0x20, scope);
+ work->dmb_name = nmbname;
+ work->dmb_addr = from_ip;
}
break;
}