summaryrefslogtreecommitdiff
path: root/source/nameservreply.c
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1996-10-27 14:22:56 +0000
committerSamba Release Account <samba-bugs@samba.org>1996-10-27 14:22:56 +0000
commitb289db62f1a53f1a68ea48dbfa59720cc778d39c (patch)
tree4104cc25b76829cbb4018c302f65691dc20d45a1 /source/nameservreply.c
parent89675f8ae8f136fb587690b137f4413607d30c14 (diff)
downloadsamba-b289db62f1a53f1a68ea48dbfa59720cc778d39c.tar.gz
severe debugging session for nmbd. in fact, i'm surprised that browsing
in 1.9.16 works at all! question and resource record types for queries and response netbios packets sorted out properly (see rfc1002.txt 4.2.1.3). receipt of browser announcement packets were playing up lkcl
Diffstat (limited to 'source/nameservreply.c')
-rw-r--r--source/nameservreply.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/source/nameservreply.c b/source/nameservreply.c
index df30e4ac412..544cbc62b44 100644
--- a/source/nameservreply.c
+++ b/source/nameservreply.c
@@ -127,9 +127,9 @@ void reply_name_release(struct packet_struct *p)
}
if (bcast)
- search &= FIND_LOCAL;
+ search |= FIND_LOCAL;
else
- search &= FIND_WINS;
+ search |= FIND_WINS;
n = find_name_search(&d, &nmb->question.question_name,
search, ip);
@@ -183,7 +183,7 @@ void reply_name_reg(struct packet_struct *p)
putip((char *)&from_ip,&nmb->additional->rdata[2]);
ip = from_ip;
- DEBUG(3,("Name registration for name %s at %s\n",
+ DEBUG(3,("Name registration for name %s at %s - ",
namestr(question),inet_ntoa(ip)));
if (group)
@@ -201,15 +201,16 @@ void reply_name_reg(struct packet_struct *p)
}
if (bcast)
- search &= FIND_LOCAL;
+ search |= FIND_LOCAL;
else
- search &= FIND_WINS;
+ search |= FIND_WINS;
/* see if the name already exists */
n = find_name_search(&d, question, search, from_ip);
if (n)
{
+ DEBUG(3,("found\n"));
if (!group) /* unique names */
{
if (n->source == SELF || NAME_GROUP(n->ip_flgs[0].nb_flags))
@@ -259,6 +260,7 @@ void reply_name_reg(struct packet_struct *p)
}
else
{
+ DEBUG(3,("not found\n"));
/* add the name to our name/subnet, or WINS, database */
n = add_netbios_entry(d,qname,qname_type,nb_flags,ttl,REGISTER,ip,
True,!bcast);
@@ -458,10 +460,8 @@ void reply_name_status(struct packet_struct *p)
reply_netbios_packet(p,nmb->header.name_trn_id,
0,NMB_STATUS,0,True,
&nmb->question.question_name,
- nmb->question.question_type,
- nmb->question.question_class,
- 0,
- rdata,PTR_DIFF(buf,rdata));
+ 0x21, 0x01,
+ 0, rdata,PTR_DIFF(buf,rdata));
}
@@ -549,8 +549,8 @@ void reply_name_query(struct packet_struct *p)
n = find_name_search(&d, question, search, p->ip);
/* it is a name that already failed DNS lookup or it's expired */
- if (n->source == DNSFAIL ||
- (n->death_time && n->death_time < p->timestamp))
+ if (n && (n->source == DNSFAIL ||
+ (n->death_time && n->death_time < p->timestamp)))
{
success = False;
}
@@ -625,8 +625,7 @@ void reply_name_query(struct packet_struct *p)
reply_netbios_packet(p,nmb->header.name_trn_id,
rcode,NMB_QUERY,0,True,
&nmb->question.question_name,
- nmb->question.question_type,
- nmb->question.question_class,
+ 0x20, 0x01,
ttl,
rdata, success ? 6 : 0);
}