summaryrefslogtreecommitdiffstats
path: root/source/namedbname.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-08-21 08:30:29 +0000
committerAndrew Tridgell <tridge@samba.org>1996-08-21 08:30:29 +0000
commit04353a9479c01322e34b2f59330fd74a759f6869 (patch)
tree8430087a40a564c0867bea562654bb0670ddba63 /source/namedbname.c
parent07b0cf29d345d2f880a45d8bcbfec8355f1f83ef (diff)
downloadsamba-04353a9479c01322e34b2f59330fd74a759f6869.tar.gz
samba-04353a9479c01322e34b2f59330fd74a759f6869.tar.xz
samba-04353a9479c01322e34b2f59330fd74a759f6869.zip
- bit a bit manipulation bug in find_name_search()
- add the * and __SAMBA__ names to all subnets - sort the name status reply list and remove duplicate entries.
Diffstat (limited to 'source/namedbname.c')
-rw-r--r--source/namedbname.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/source/namedbname.c b/source/namedbname.c
index 58b62bd0cbc..1f16553b0f4 100644
--- a/source/namedbname.c
+++ b/source/namedbname.c
@@ -173,27 +173,25 @@ struct name_record *find_name_search(struct subnet_record **d,
{
if (d == NULL) return NULL; /* bad error! */
- if ((search & FIND_LOCAL) == 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) != FIND_WINS) return NULL;
-
- /* find WINS subnet record. */
- *d = find_subnet(ipgrp);
+ 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 (*d == NULL) return NULL;
+ if (!(search & FIND_WINS)) 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(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);
}