JHT ===> Update only.
[samba.git] / source / namedbresp.c
index d89bfe8ae843bbd042faf8dffdaf8ee895c9a87b..98f8ca774bc553ebebb42cf6a5526a7dd760eeba 100644 (file)
@@ -2,7 +2,7 @@
    Unix SMB/Netbios implementation.
    Version 1.9.
    NBT netbios library routines
-   Copyright (C) Andrew Tridgell 1994-1996
+   Copyright (C) Andrew Tridgell 1994-1997
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -34,7 +34,6 @@ extern int DEBUGLEVEL;
 extern pstring scope;
 extern pstring myname;
 extern struct in_addr ipzero;
-extern struct in_addr ipgrp;
 
 int num_response_packets = 0;
 
@@ -117,9 +116,14 @@ struct response_record *make_response_queue_record(enum state_type state,
   n->recurse = recurse;
   n->send_ip = send_ip;
   n->reply_to_ip = reply_to_ip;
-  StrnCpy(my_name   , n->my_name   , sizeof(n->my_name   )-1);
-  StrnCpy(my_comment, n->my_comment, sizeof(n->my_comment)-1);
-
+  if(my_name)
+    StrnCpy(n->my_name, my_name, sizeof(n->my_name)-1);
+  else
+    *n->my_name = 0;
+  if(my_comment)
+    StrnCpy(n->my_comment, my_comment, sizeof(n->my_comment)-1);
+  else
+    *n->my_comment = 0;
   n->repeat_interval = 1; /* XXXX should be in ms */
   n->repeat_count = 3; /* 3 retries */
   n->repeat_time = time(NULL) + n->repeat_interval; /* initial retry time */
@@ -140,7 +144,7 @@ struct response_record *find_response_record(struct subnet_record **d,
 
   if (!d) return NULL;
 
-  for ((*d) = subnetlist; (*d); (*d) = (*d)->next)
+  for ((*d) = FIRST_SUBNET; (*d); (*d) = NEXT_SUBNET_INCLUDING_WINS(*d))
   {
     for (n = (*d)->responselist; n; n = n->next)
     {