changed nmblookup to only set recursion_desired in queries if the -R
authorAndrew Tridgell <tridge@samba.org>
Wed, 19 Nov 1997 23:50:02 +0000 (23:50 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 19 Nov 1997 23:50:02 +0000 (23:50 +0000)
option is used.

source/libsmb/namequery.c
source/utils/nmblookup.c

index 55f70be122282141bb300b7a6ded554cf4bd7c40..15bf58bc559451baa561af1336abd3a70d6b42b3 100644 (file)
@@ -214,7 +214,7 @@ BOOL name_query(int fd,char *name,int name_type,
   nmb->header.response = False;
   nmb->header.nm_flags.bcast = bcast;
   nmb->header.nm_flags.recursion_available = False;
-  nmb->header.nm_flags.recursion_desired = True;
+  nmb->header.nm_flags.recursion_desired = recurse;
   nmb->header.nm_flags.trunc = False;
   nmb->header.nm_flags.authoritative = False;
   nmb->header.rcode = 0;
index a44dad511e27a0fd022931a9ed7b652a9e540617..1f74d7a130f08bf2aea1a384ba3ec6c40d4ae992 100644 (file)
@@ -77,7 +77,9 @@ static void usage(void)
   printf("Version %s\n",VERSION);
   printf("\t-d debuglevel         set the debuglevel\n");
   printf("\t-B broadcast address  the address to use for broadcasts\n");
+  printf("\t-U unicast   address  the address to use for unicast\n");
   printf("\t-M                    searches for a master browser\n");
+  printf("\t-R                    set recursion desired in packet\n");
   printf("\t-S                    lookup node status as well\n");
   printf("\t-r                    Use root port 137 (Win95 only replies to this)\n");
   printf("\t-A                    Do a node status on <name> as an IP Address\n");
@@ -103,7 +105,8 @@ int main(int argc,char *argv[])
   BOOL use_bcast = True;
   BOOL got_bcast = False;
   BOOL lookup_by_ip = False;
-  
+  BOOL recursion_desired = False;
+
   DEBUGLEVEL = 1;
   *lookup = 0;
 
@@ -113,7 +116,7 @@ int main(int argc,char *argv[])
 
   charset_initialise();
 
-  while ((opt = getopt(argc, argv, "d:B:U:i:s:SMrhA")) != EOF)
+  while ((opt = getopt(argc, argv, "d:B:U:i:s:SMrhAR")) != EOF)
     switch (opt)
       {
       case 'B':
@@ -138,6 +141,9 @@ int main(int argc,char *argv[])
       case 'S':
        find_status = True;
        break;
+      case 'R':
+       recursion_desired = True;
+       break;
       case 'd':
        DEBUGLEVEL = atoi(optarg);
        break;
@@ -213,7 +219,7 @@ int main(int argc,char *argv[])
        retries = 1;
       }
 
-      if (name_query(ServerFD,lookup,lookup_type,use_bcast,True,
+      if (name_query(ServerFD,lookup,lookup_type,use_bcast,recursion_desired,
                     bcast_addr,&ip,NULL)) 
       {
         printf("%s %s\n",inet_ntoa(ip),lookup);