summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-12-04 22:22:37 +0000
committerLuke Leighton <lkcl@samba.org>1999-12-04 22:22:37 +0000
commit97913d82f56388eee7d8fa8c204a1fa8c9754b88 (patch)
tree0098c3f3e26d9e05811cecd141fdb45a4fa95847
parentc41205e28f39feb090ea6fe4357d0fa714d38bef (diff)
downloadsamba-97913d82f56388eee7d8fa8c204a1fa8c9754b88.tar.gz
samba-97913d82f56388eee7d8fa8c204a1fa8c9754b88.tar.bz2
samba-97913d82f56388eee7d8fa8c204a1fa8c9754b88.zip
argh. trying to get the nmb agent code to filter out "self" packets.
(This used to be commit 84d7cc63239ea67481f6382da58d0678a21011fb)
-rw-r--r--source3/libsmb/namequery.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index 79fb27bd6f..0d9cc54f21 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -273,20 +273,12 @@ struct in_addr *name_query(int fd,const char *name,int name_type, BOOL bcast,BOO
p.timestamp = time(NULL);
p.packet_type = packet_type;
- GetTimeOfDay(&tval);
-
- if (!send_packet(&p))
- {
- if (packet_type == NMB_SOCK_PACKET) close(fd);
- return NULL;
- }
+ ZERO_STRUCT(tval);
while (retries >= 0)
{
struct timeval tval2;
- retries--;
-
GetTimeOfDay(&tval2);
if (TvalDiff(&tval,&tval2) > retry_time)
{
@@ -319,6 +311,8 @@ struct in_addr *name_query(int fd,const char *name,int name_type, BOOL bcast,BOO
continue;
}
+ retries--;
+
if (nmb2->header.opcode != 0 ||
nmb2->header.nm_flags.bcast ||
nmb2->header.rcode ||