summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher R. Hertel <crh@samba.org>2001-06-28 20:49:47 +0000
committerChristopher R. Hertel <crh@samba.org>2001-06-28 20:49:47 +0000
commit9e7896144ae1f7cc4539d875e6c2a94f8b54a2bb (patch)
tree6d4dfde4cc10ab4d4496de2365a736153a47559f
parenteb57553512d22fa2de4233cf7161a4cbb55ce04a (diff)
downloadsamba-9e7896144ae1f7cc4539d875e6c2a94f8b54a2bb.tar.gz
samba-9e7896144ae1f7cc4539d875e6c2a94f8b54a2bb.tar.bz2
samba-9e7896144ae1f7cc4539d875e6c2a94f8b54a2bb.zip
Added info to some of the debug messages to get a better handle on a problem
people are reporting regarding multiple responses to queries on <1D> names. There should only ever be one LMB but some users are seeing multiple replies to queries for the LMB name. This is probably due to nodes on the LAN that have NetBIOS over NetBEUI and/or IPX enabled. Previously, the debug message did not include the IP address associated with the name. It *did* include the source address of the packet, but in the examples I've seen all of these were the same, eg: [2000/06/22 11:58:25, 0] nmbd/nmbd_namequery.c:query_name_response(93) query_name_response: Multiple (2) responses received for a query on subnet 129.130.10.136 for name NT.CIS.KSU.EDU<1d>. This response was from IP 129.130.10.24 [2000/06/22 11:58:25, 0] nmbd/nmbd_namequery.c:query_name_response(93) query_name_response: Multiple (3) responses received for a query on subnet 129.130.10.136 for name NT.CIS.KSU.EDU<1d>. This response was from IP 129.130.10.24 [2000/06/22 11:58:25, 0] nmbd/nmbd_namequery.c:query_name_response(93) query_name_response: Multiple (4) responses received for a query on subnet 129.130.10.136 for name NT.CIS.KSU.EDU<1d>. This response was from IP 129.130.10.24 [2000/06/22 11:58:25, 0] nmbd/nmbd_namequery.c:query_name_response(93) query_name_response: Multiple (5) responses received for a query on subnet 129.130.10.136 for name NT.CIS.KSU.EDU<1d>. This response was from IP 129.130.10.24 Note that all of the above are reported as having come from 129.130.10.24. This should never happen. If 129.130.10.24 is a WINS server it should send a Negative Name Query Response for a <1D> name query (wierd but true). So, are all of the above coming from different systems, all of which think are the LMB? Are they all coming from one system that is, for some strange reason, replying five times to the same query? Anyway, I needed more info so I've changed the debug messages. Chris -)----- (This used to be commit 8f2f09af0a0a80cacef933ed500884e2c0b3f2fb)
-rw-r--r--source3/nmbd/nmbd_namequery.c80
1 files changed, 56 insertions, 24 deletions
diff --git a/source3/nmbd/nmbd_namequery.c b/source3/nmbd/nmbd_namequery.c
index 57baa4cb2f..61435c14f5 100644
--- a/source3/nmbd/nmbd_namequery.c
+++ b/source3/nmbd/nmbd_namequery.c
@@ -30,8 +30,9 @@ extern int DEBUGLEVEL;
Deal with a response packet when querying a name.
****************************************************************************/
-static void query_name_response(struct subnet_record *subrec,
- struct response_record *rrec, struct packet_struct *p)
+static void query_name_response( struct subnet_record *subrec,
+ struct response_record *rrec,
+ struct packet_struct *p)
{
struct nmb_packet *nmb = &p->packet.nmb;
BOOL success = False;
@@ -52,9 +53,14 @@ static void query_name_response(struct subnet_record *subrec,
{
/* WINS server is telling us to wait. Pretend we didn't get
the response but don't send out any more query requests. */
-
- DEBUG(5,("query_name_response: WACK from WINS server %s in querying \
-name %s on subnet %s.\n", inet_ntoa(p->ip), nmb_namestr(question_name), subrec->subnet_name));
+
+ if( DEBUGLVL( 5 ) )
+ {
+ dbgtext( "query_name_response: " );
+ dbgtext( "WACK from WINS server %s ", inet_ntoa(p->ip) );
+ dbgtext( "in querying name %s ", nmb_namestr(question_name) );
+ dbgtext( "on subnet %s.\n", subrec->subnet_name );
+ }
rrec->repeat_count = 0;
/* How long we should wait for. */
@@ -66,18 +72,26 @@ name %s on subnet %s.\n", inet_ntoa(p->ip), nmb_namestr(question_name), subrec->
{
success = False;
- DEBUG(5,("query_name_response: On subnet %s - negative response \
-from IP %s for name %s. Error code was %d.\n", subrec->subnet_name, inet_ntoa(p->ip),
- nmb_namestr(question_name), nmb->header.rcode));
+ if( DEBUGLVL( 5 ) )
+ {
+ dbgtext( "query_name_response: On subnet %s ", subrec->subnet_name );
+ dbgtext( "- negative response from IP %s ", inet_ntoa(p->ip) );
+ dbgtext( "for name %s. ", nmb_namestr(question_name) );
+ dbgtext( "Error code was %d.\n", nmb->header.rcode );
+ }
}
else
{
success = True;
putip((char *)&answer_ip,&nmb->answers->rdata[2]);
- DEBUG(5,("query_name_response: On subnet %s - positive response from IP %s \
-for name %s. IP of that name is %s\n", subrec->subnet_name, inet_ntoa(p->ip),
- nmb_namestr(question_name), inet_ntoa(answer_ip)));
+ if( DEBUGLVL( 5 ) )
+ {
+ dbgtext( "query_name_response: On subnet %s ", subrec->subnet_name );
+ dbgtext( "- positive response from IP %s ", inet_ntoa(p->ip) );
+ dbgtext( "for name %s. ", nmb_namestr(question_name) );
+ dbgtext( "IP of that name is %s\n", inet_ntoa(answer_ip) );
+ }
/* Interestingly, we could add these names to our namelists, and
change nmbd to a model that checked its own name cache first,
@@ -87,10 +101,15 @@ for name %s. IP of that name is %s\n", subrec->subnet_name, inet_ntoa(p->ip),
}
else if( rrec->num_msgs > 1)
{
- DEBUG(0,("query_name_response: Multiple (%d) responses received for a query on \
-subnet %s for name %s. This response was from IP %s\n",
- rrec->num_msgs, subrec->subnet_name, nmb_namestr(question_name),
- inet_ntoa(p->ip) ));
+ if( DEBUGLVL( 0 ) )
+ {
+ dbgtext( "query_name_response: " );
+ dbgtext( "Multiple (%d) responses ", rrec->num_msgs );
+ dbgtext( "received for a query on subnet %s ", subrec->subnet_name );
+ dbgtext( "for name %s.\nThis response ", nmb_namestr(question_name) );
+ dbgtext( "was from IP %s, reporting", inet_ntoa(p->ip) );
+ dbgtext( "an IP address of %s.\n", inet_ntoa(answer_ip) );
+ }
/* We have already called the success or fail function, so we
don't call again here. Leave the response record around in
@@ -128,9 +147,12 @@ static void query_name_timeout_response(struct subnet_record *subrec,
if(failed)
{
- DEBUG(5,("query_name_timeout_response: No response to querying name %s on subnet %s.\n",
- nmb_namestr(question_name), subrec->subnet_name));
-
+ if( DEBUGLVL( 5 ) )
+ {
+ dbgtext( "query_name_timeout_response: No response to " );
+ dbgtext( "query for name %s ", nmb_namestr(question_name) );
+ dbgtext( "on subnet %s.\n", subrec->subnet_name );
+ }
if(rrec->fail_fn)
(*rrec->fail_fn)(subrec, rrec, question_name, 0);
}
@@ -201,8 +223,12 @@ BOOL query_name(struct subnet_record *subrec, char *name, int type,
rrec.rdlength = namerec->data.num_ips * 6;
if(rrec.rdlength > MAX_DGRAM_SIZE)
{
- DEBUG(0,("query_name: nmbd internal error - there are %d ip addresses for name %s.\n",
- namerec->data.num_ips, nmb_namestr(&nmbname) ));
+ if( DEBUGLVL( 0 ) )
+ {
+ dbgtext( "query_name: nmbd internal error - " );
+ dbgtext( "there are %d ip addresses ", namerec->data.num_ips );
+ dbgtext( "for name %s.\n", nmb_namestr(&nmbname) );
+ }
return False;
}
@@ -226,8 +252,11 @@ BOOL query_name(struct subnet_record *subrec, char *name, int type,
userdata,
&nmbname) == NULL)
{
- DEBUG(0,("query_name: Failed to send packet trying to query name %s\n",
- nmb_namestr(&nmbname)));
+ if( DEBUGLVL( 0 ) )
+ {
+ dbgtext( "query_name: Failed to send packet " );
+ dbgtext( "trying to query name %s\n", nmb_namestr(&nmbname) );
+ }
return True;
}
return False;
@@ -255,8 +284,11 @@ BOOL query_name_from_wins_server(struct in_addr ip_to,
userdata,
&nmbname) == NULL)
{
- DEBUG(0,("query_name_from_wins_server: Failed to send packet trying to query name %s\n",
- nmb_namestr(&nmbname)));
+ if( DEBUGLVL( 0 ) )
+ {
+ dbgtext( "query_name_from_wins_server: Failed to send packet " );
+ dbgtext( "trying to query name %s\n", nmb_namestr(&nmbname) );
+ }
return True;
}
return False;