summaryrefslogtreecommitdiff
path: root/source3/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
commitf14a7c5ce8864714fa8fa7f8fe8d630a6ab0861f (patch)
tree6fcdf37e1e643c964d2fee155808dcc3caf190e2 /source3/nameservreply.c
parent697e46373c8fa7b07234f6611c93cf25fe9733ed (diff)
downloadsamba-f14a7c5ce8864714fa8fa7f8fe8d630a6ab0861f.tar.gz
samba-f14a7c5ce8864714fa8fa7f8fe8d630a6ab0861f.tar.bz2
samba-f14a7c5ce8864714fa8fa7f8fe8d630a6ab0861f.zip
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 (This used to be commit b289db62f1a53f1a68ea48dbfa59720cc778d39c)
Diffstat (limited to 'source3/nameservreply.c')
-rw-r--r--source3/nameservreply.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/source3/nameservreply.c b/source3/nameservreply.c
index df30e4ac41..544cbc62b4 100644
--- a/source3/nameservreply.c
+++ b/source3/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);
}