clitar.c: Fixed gcc warning with comment in /* */ code.
authorJeremy Allison <jra@samba.org>
Thu, 25 Jun 1998 23:51:28 +0000 (23:51 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 25 Jun 1998 23:51:28 +0000 (23:51 +0000)
nmbd_winsserver.c: Remember to free packet in multi-homed register code.
                   Use correct query_name_from_wins_server call instead of
                   query_name call in multihomed code.
Jeremy.

source/client/clitar.c
source/nmbd/nmbd_winsserver.c

index eba82ba217902bc4e803c52b75ba54e8a4d2fc73..d286477d7d2dfd6503dc5d1f97cc7d5935b3f34d 100644 (file)
@@ -1973,7 +1973,7 @@ static void do_tarput()
                    if (tar_real_noisy) {
                      DEBUG(0, ("Could not set time on file: %s\n", finfo.name));
                    }
-                    /*return; /* Win 95 does not like setting time on dirs */
+                    /*return;  - Win 95 does not like setting time on dirs */
 
                   }
 
index e8dd78f1abe4ef2510ca1983c6c57876aed9279c..f663362706995aaa88481d598c5c689c3520f744 100644 (file)
@@ -881,6 +881,10 @@ static void wins_multihomed_register_query_success(struct subnet_record *subrec,
     DEBUG(3,("wins_multihomed_register_query_success: name %s is not in the correct state to add \
 a subsequent IP addess.\n", namestr(question_name) ));
     send_wins_name_registration_response(RFS_ERR, 0, orig_reg_packet);
+
+    orig_reg_packet->locked = False;
+    free_packet(orig_reg_packet);
+
     return;
   }
 
@@ -889,6 +893,8 @@ a subsequent IP addess.\n", namestr(question_name) ));
   update_name_ttl(namerec, ttl);
   send_wins_name_registration_response(0, ttl, orig_reg_packet);
 
+  orig_reg_packet->locked = False;
+  free_packet(orig_reg_packet);
 }
 
 /***********************************************************************
@@ -912,6 +918,9 @@ static void wins_multihomed_register_query_fail(struct subnet_record *subrec,
   DEBUG(3,("wins_multihomed_register_query_fail: Registering machine at IP %s failed to answer \
 query successfully for name %s.\n", inet_ntoa(orig_reg_packet->ip), namestr(question_name) ));
   send_wins_name_registration_response(RFS_ERR, 0, orig_reg_packet);
+
+  orig_reg_packet->locked = False;
+  free_packet(orig_reg_packet);
   return;
 }
 
@@ -1100,20 +1109,21 @@ is one of our (WINS server) names. Denying registration.\n", namestr(question) )
     userdata->userdata_len = sizeof(struct packet_struct *);
     memcpy(userdata->data, (char *)&p, sizeof(struct packet_struct *) );
 
-    /*
-     * As query_name uses the subnet broadcast address as the destination
-     * of the packet we temporarily change the subnet broadcast address to
-     * be the IP address of the requesting machine and send the packet. This
-     * is a *horrible* hack but the alternative is to add the destination
-     * address parameter to all query_name() calls. I hate this code :-).
+    /* 
+     * Use the new call to send a query directly to an IP address.
+     * This sends the query directly to the IP address, and ensures
+     * the recursion desired flag is not set (you were right Luke :-).
+     * This function should *only* be called from the WINS server
+     * code. JRA.
      */
 
-    subrec->bcast_ip = p->ip;
-    query_name( subrec, question->name, question->name_type,
-                wins_multihomed_register_query_success, 
-                wins_multihomed_register_query_fail,
-                userdata);
-    subrec->bcast_ip = ipzero;
+    query_name_from_wins_server( p->ip,
+                                 question->name,
+                                 question->name_type, 
+                                 wins_multihomed_register_query_success,
+                                 wins_multihomed_register_query_fail,
+                                 userdata );
+
     return;
   }