summaryrefslogtreecommitdiffstats
path: root/source/namework.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/namework.c
parent89675f8ae8f136fb587690b137f4413607d30c14 (diff)
downloadsamba-b289db62f1a53f1a68ea48dbfa59720cc778d39c.tar.gz
samba-b289db62f1a53f1a68ea48dbfa59720cc778d39c.tar.xz
samba-b289db62f1a53f1a68ea48dbfa59720cc778d39c.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
Diffstat (limited to 'source/namework.c')
-rw-r--r--source/namework.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/source/namework.c b/source/namework.c
index 80183dac84f..f4a9113cea7 100644
--- a/source/namework.c
+++ b/source/namework.c
@@ -175,8 +175,7 @@ BOOL same_context(struct dgram_packet *dgram)
static void process_announce(struct packet_struct *p,uint16 command,char *buf)
{
struct dgram_packet *dgram = &p->packet.dgram;
- struct in_addr ip = dgram->header.source_ip;
- struct subnet_record *d = find_subnet(ip);
+ struct subnet_record *d = find_subnet(p->ip);
int update_count = CVAL(buf,0);
int ttl = IVAL(buf,1)/1000;
@@ -213,7 +212,7 @@ static void process_announce(struct packet_struct *p,uint16 command,char *buf)
dgram->dest_name.name_type != 0x1))
{
DEBUG(0,("Announce(%d) from %s should be __MSBROWSE__(1) not %s\n",
- command, inet_ntoa(ip), namestr(&dgram->dest_name)));
+ command, inet_ntoa(p->ip), namestr(&dgram->dest_name)));
return;
}
@@ -243,6 +242,9 @@ static void process_announce(struct packet_struct *p,uint16 command,char *buf)
dgram->dest_name.name_type == 0x1e))
add = True;
+ DEBUG(4,("search for workgroup: %s (add? %s)\n",
+ work_name, BOOLSTR(add)));
+
if (!(work = find_workgroupstruct(d, work_name,add)))
return;
@@ -265,7 +267,7 @@ static void process_announce(struct packet_struct *p,uint16 command,char *buf)
if (command == ANN_LocalMasterAnnouncement)
{
add_browser_entry(serv_name,dgram->dest_name.name_type,
- work->work_group,30,ip,True);
+ work->work_group,30,p->ip,True);
}
}
@@ -275,27 +277,25 @@ static void process_announce(struct packet_struct *p,uint16 command,char *buf)
static void process_master_announce(struct packet_struct *p,char *buf)
{
struct dgram_packet *dgram = &p->packet.dgram;
- struct in_addr ip = dgram->header.source_ip;
- struct subnet_record *d = find_subnet(ip);
- struct subnet_record *mydomain = find_subnet(*iface_bcast(ip));
+ struct subnet_record *d = find_subnet(p->ip);
char *name = buf;
struct work_record *work;
name[15] = 0;
- DEBUG(3,("Master Announce from %s (%s)\n",name,inet_ntoa(ip)));
+ DEBUG(3,("Master Announce from %s (%s)\n",name,inet_ntoa(p->ip)));
if (same_context(dgram)) return;
- if (!d || !mydomain) return;
+ if (!d) return;
if (!lp_domain_master()) return;
- for (work = mydomain->workgrouplist; work; work = work->next)
+ for (work = d->workgrouplist; work; work = work->next)
{
if (AM_MASTER(work))
{
/* merge browse lists with them */
- add_browser_entry(name,0x1b, work->work_group,30,ip,True);
+ add_browser_entry(name,0x1b, work->work_group,30,p->ip,True);
}
}
}
@@ -316,13 +316,12 @@ static void process_master_announce(struct packet_struct *p,char *buf)
static void process_rcv_backup_list(struct packet_struct *p,char *buf)
{
struct dgram_packet *dgram = &p->packet.dgram;
- struct in_addr ip = dgram->header.source_ip;
int count = CVAL(buf,0);
uint32 info = IVAL(buf,1); /* XXXX caller's incremental info */
char *buf1;
DEBUG(3,("Receive Backup ack for %s from %s total=%d info=%d\n",
- namestr(&dgram->dest_name), inet_ntoa(ip),
+ namestr(&dgram->dest_name), inet_ntoa(p->ip),
count, info));
if (same_context(dgram)) return;
@@ -336,7 +335,7 @@ static void process_rcv_backup_list(struct packet_struct *p,char *buf)
/* struct subnet_record *d; */
DEBUG(4,("Searching for backup browser %s at %s...\n",
- buf1, inet_ntoa(ip)));
+ buf1, inet_ntoa(p->ip)));
/* XXXX assume name is a DNS name NOT a netbios name. a more complete
approach is to use reply_name_query functionality to find the name */