summaryrefslogtreecommitdiff
path: root/source3/namedbname.c
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1997-04-09 01:19:25 +0000
committerSamba Release Account <samba-bugs@samba.org>1997-04-09 01:19:25 +0000
commit20b5dea237916902437ce3dcdb7c253fd1ad3585 (patch)
treee68a033a708efed2c93c95a73da978ebf9221c34 /source3/namedbname.c
parent02e610b927c9038cf498f726d807ee95a14714be (diff)
downloadsamba-20b5dea237916902437ce3dcdb7c253fd1ad3585.tar.gz
samba-20b5dea237916902437ce3dcdb7c253fd1ad3585.tar.bz2
samba-20b5dea237916902437ce3dcdb7c253fd1ad3585.zip
Large changes from jra@cygnus.com. Mainly browser updates.
access.c: Fixed crash if yp domain unavailable. includes.h: Moved ifdefs for minor platform. interface.c: Changed name of ipgrp to wins_ip to make it clearer. loadparm.c: Changed default of wins support to 'no'. nameannounce.c: Many changes to fix cross subnet browsing. namebrowse.c: Many changes to fix cross subnet browsing. namedbname.c: Many changes to fix cross subnet browsing. namedbresp.c: Many changes to fix cross subnet browsing. namedbsubnet.c: Many changes to fix cross subnet browsing. namedbwork.c: Many changes to fix cross subnet browsing. nameelect.c: Many changes to fix cross subnet browsing. namelogon.c: Many changes to fix cross subnet browsing. namepacket.c: Many changes to fix cross subnet browsing. nameresp.c: Many changes to fix cross subnet browsing. nameserv.c: Many changes to fix cross subnet browsing. nameserv.h: Many changes to fix cross subnet browsing. nameservreply.c: Many changes to fix cross subnet browsing. nameservresp.c: Many changes to fix cross subnet browsing. namework.c: Many changes to fix cross subnet browsing. nmbd.c: Change to search wins subnet. nmbsync.c: Change to check if we are any master before proceeding. proto.h: Added find_subnet_all() and check_work_servertype(). util.c: Moved 'done' settings on name resolution. (This used to be commit a82476eee2c521e5eed092bc367da0a7cef23de1)
Diffstat (limited to 'source3/namedbname.c')
-rw-r--r--source3/namedbname.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/source3/namedbname.c b/source3/namedbname.c
index 2e8c8d589a..d27bcf8158 100644
--- a/source3/namedbname.c
+++ b/source3/namedbname.c
@@ -35,7 +35,7 @@ extern int DEBUGLEVEL;
extern pstring scope;
extern struct in_addr ipzero;
-extern struct in_addr ipgrp;
+extern struct in_addr wins_ip;
extern struct subnet_record *subnetlist;
@@ -153,10 +153,11 @@ struct name_record *find_name(struct name_record *n,
{
continue;
}
-
+ DEBUG(9,("find_name: found name %s\n", name->name));
return ret;
}
}
+ DEBUG(9,("find_name: name %s NOT FOUND\n", name->name));
return NULL;
}
@@ -172,27 +173,27 @@ struct name_record *find_name_search(struct subnet_record **d,
struct nmb_name *name,
int search, struct in_addr ip)
{
- if (d == NULL) return NULL; /* bad error! */
+ if (d == NULL) return NULL; /* bad error! */
- if (search & FIND_LOCAL) {
- if (*d != NULL) {
- struct name_record *n = find_name((*d)->namelist, name, search);
- DEBUG(4,("find_name on local: %s %s search %x\n",
- namestr(name),inet_ntoa(ip), search));
- if (n) return n;
- }
+ if (search & FIND_LOCAL) {
+ if (*d != NULL) {
+ struct name_record *n = find_name((*d)->namelist, name, search);
+ DEBUG(4,("find_name on local: %s %s search %x\n",
+ namestr(name),inet_ntoa(ip), search));
+ if (n) return n;
}
+ }
- if (!(search & FIND_WINS)) return NULL;
+ if (!(search & FIND_WINS)) return NULL;
- /* find WINS subnet record. */
- *d = find_subnet(ipgrp);
-
- if (*d == NULL) return NULL;
-
- DEBUG(4,("find_name on WINS: %s %s search %x\n",
- namestr(name),inet_ntoa(ip), search));
- return find_name((*d)->namelist, name, search);
+ /* find WINS subnet record. */
+ *d = find_subnet(wins_ip);
+
+ if (*d == NULL) return NULL;
+
+ DEBUG(4,("find_name on WINS: %s %s search %x\n",
+ namestr(name),inet_ntoa(ip), search));
+ return find_name((*d)->namelist, name, search);
}
@@ -245,7 +246,7 @@ void dump_names(void)
}
DEBUG(4,("\n"));
- if (f && ip_equal(d->bcast_ip, ipgrp) && n->source == REGISTER)
+ if (f && ip_equal(d->bcast_ip, wins_ip) && n->source == REGISTER)
{
/* XXXX i have little imagination as to how to output nb_flags as
anything other than as a hexadecimal number :-) */
@@ -281,7 +282,7 @@ void dump_names(void)
****************************************************************************/
void load_netbios_names(void)
{
- struct subnet_record *d = find_subnet(ipgrp);
+ struct subnet_record *d = find_subnet(wins_ip);
fstring fname;
FILE *f;
@@ -466,8 +467,9 @@ struct name_record *add_netbios_entry(struct subnet_record *d,
if (!n2) add_name(d,n);
- DEBUG(3,("Added netbios name %s at %s ttl=%d nb_flags=%2x\n",
- namestr(&n->name),inet_ntoa(ip),ttl,nb_flags));
+ DEBUG(3,("Added netbios name %s at %s ttl=%d nb_flags=%2x to interface %s\n",
+ namestr(&n->name),inet_ntoa(ip),ttl,nb_flags,
+ ip_equal(d->bcast_ip, wins_ip) ? "WINS" : inet_ntoa(d->bcast_ip)));
return(n);
}
@@ -520,7 +522,7 @@ struct name_record *dns_name_search(struct nmb_name *question, int Time)
char *r;
BOOL dns_type = (name_type == 0x20 || name_type == 0);
struct in_addr dns_ip;
- struct subnet_record *d = find_subnet(ipgrp);
+ struct subnet_record *d = find_subnet(wins_ip);
if (d == NULL) return NULL;