summaryrefslogtreecommitdiff
path: root/source3/nameservresp.c
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1996-07-10 18:48:49 +0000
committerSamba Release Account <samba-bugs@samba.org>1996-07-10 18:48:49 +0000
commite5a0619c2839d45b00446c3af3f30599f3f3c5fa (patch)
treee4f788fae8109e372f55ecc53a40a19740655cc8 /source3/nameservresp.c
parent9d59ce1d5715f64105643b01aea8b5b9cba8d5a2 (diff)
downloadsamba-e5a0619c2839d45b00446c3af3f30599f3f3c5fa.tar.gz
samba-e5a0619c2839d45b00446c3af3f30599f3f3c5fa.tar.bz2
samba-e5a0619c2839d45b00446c3af3f30599f3f3c5fa.zip
updated docs to match code mods from last two or three updates. done
some more commenting of code to match docs. sorted some bugs. ipc BOOL domains was uninitialised. lkcl (This used to be commit cb43ce7bc08fa43a6ce49e0937f13afec5dce67b)
Diffstat (limited to 'source3/nameservresp.c')
-rw-r--r--source3/nameservresp.c70
1 files changed, 36 insertions, 34 deletions
diff --git a/source3/nameservresp.c b/source3/nameservresp.c
index dc7cc63c5a..e47afc55b3 100644
--- a/source3/nameservresp.c
+++ b/source3/nameservresp.c
@@ -46,7 +46,8 @@ extern struct in_addr ipzero;
response for a reg release received. samba has asked a WINS server if it
could release a name.
**************************************************************************/
-void response_name_release(struct subnet_record *d, struct packet_struct *p)
+static void response_name_release(struct subnet_record *d,
+ struct packet_struct *p)
{
struct nmb_packet *nmb = &p->packet.nmb;
char *name = nmb->question.question_name.name;
@@ -55,33 +56,42 @@ void response_name_release(struct subnet_record *d, struct packet_struct *p)
DEBUG(4,("response name release received\n"));
if (nmb->header.rcode == 0 && nmb->answers->rdata)
- {
- /* IMPORTANT: see expire_netbios_response_entries() */
+ {
+ /* IMPORTANT: see expire_netbios_response_entries() */
- struct in_addr found_ip;
- putip((char*)&found_ip,&nmb->answers->rdata[2]);
+ struct in_addr found_ip;
+ putip((char*)&found_ip,&nmb->answers->rdata[2]);
- if (ismyip(found_ip))
- {
- remove_netbios_name(d,name,type,SELF,found_ip);
- }
+ /* NOTE: we only release our own names at present */
+ if (ismyip(found_ip))
+ {
+ name_unregister_work(d,name,type);
}
- else
+ else
{
- DEBUG(2,("name release for %s rejected!\n",
+ DEBUG(2,("name release for different ip! %s %s\n",
+ inet_ntoa(found_ip),
+ namestr(&nmb->question.question_name)));
+ }
+ }
+ else
+ {
+ DEBUG(2,("name release for %s rejected!\n",
namestr(&nmb->question.question_name)));
- /* XXXX do we honestly care if our name release was rejected?
- only if samba is issuing the release on behalf of some out-of-sync
- server. if it's one of samba's SELF names, we don't care. */
- }
+ /* XXXX PANIC! what to do if it's one of samba's own names? */
+
+ /* XXXX do we honestly care if our name release was rejected?
+ only if samba is issuing the release on behalf of some out-of-sync
+ server. if it's one of samba's SELF names, we don't care. */
+ }
}
/****************************************************************************
response for a reg request received
**************************************************************************/
-void response_name_reg(struct subnet_record *d, struct packet_struct *p)
+static void response_name_reg(struct subnet_record *d, struct packet_struct *p)
{
struct nmb_packet *nmb = &p->packet.nmb;
char *name = nmb->question.question_name.name;
@@ -92,25 +102,22 @@ void response_name_reg(struct subnet_record *d, struct packet_struct *p)
if (nmb->header.rcode == 0 && nmb->answers->rdata)
{
- /* IMPORTANT: see expire_netbios_response_entries() */
+ /* IMPORTANT: see expire_netbios_response_entries() */
- int nb_flags = nmb->answers->rdata[0];
- int ttl = nmb->answers->ttl;
- struct in_addr found_ip;
+ int nb_flags = nmb->answers->rdata[0];
+ int ttl = nmb->answers->ttl;
+ struct in_addr found_ip;
- putip((char*)&found_ip,&nmb->answers->rdata[2]);
+ putip((char*)&found_ip,&nmb->answers->rdata[2]);
- name_register_work(d,name,type,nb_flags,ttl,found_ip,bcast);
+ name_register_work(d,name,type,nb_flags,ttl,found_ip,bcast);
}
else
{
DEBUG(1,("name registration for %s rejected!\n",
namestr(&nmb->question.question_name)));
- /* XXXX oh dear. we have problems. must deal with our name having
- been rejected: e.g if it was our GROUP(1d) name, we must unbecome
- a master browser. */
-
+ /* oh dear. we have problems. possibly unbecome a master browser. */
name_unregister_work(d,name,type);
}
}
@@ -332,14 +339,9 @@ static void response_name_query_register(struct nmb_packet *nmb,
}
/* register the old or the new owners' ip */
- add_netbios_entry(d, ans_name->name, ans_name->name_type,
- n->nb_flags,GET_TTL(0),REGISTER,
- register_ip,False,True);
-
- /* reply yes or no to the host that requested the name */
- send_name_response(n->fd, n->response_id, NMB_REG,
- new_owner, True,
- &n->name, n->nb_flags, GET_TTL(0), n->reply_to_ip);
+ add_name_respond(d, n->fd, n->response_id,&n->name,n->nb_flags,
+ GET_TTL(0), register_ip,
+ new_owner, n->reply_to_ip);
}