summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_winsserver.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-04-20 20:32:50 +0000
committerJeremy Allison <jra@samba.org>1998-04-20 20:32:50 +0000
commitec6fde99ab739ff2c410e5459bba06b06d18b5dc (patch)
treeec5b68a3b311a97c61f6396d7532095c3082c153 /source3/nmbd/nmbd_winsserver.c
parent6733e2b36e00ccbe8df363651ecc98ba42d53cee (diff)
downloadsamba-ec6fde99ab739ff2c410e5459bba06b06d18b5dc.tar.gz
samba-ec6fde99ab739ff2c410e5459bba06b06d18b5dc.tar.bz2
samba-ec6fde99ab739ff2c410e5459bba06b06d18b5dc.zip
Fixed bug that John found in WINS server code. When nmbd as a WINS
server is sending out a name_query after a WACK, it needs to send a packet with recursion_desired = 0 (yes Luke, you were right all along :-). If it doesn't then if it's talking to itself then the query packet ends up back in the WINS server instead of in the client side code. Makefile: Changed proto generation to stop including NMBDOBJ twice. nmbd_namequery.c nmbd_packets.c nmbd_winsserver.c: Added extra query_name_from_wins_server() code. Jeremy. (This used to be commit c5ca05c29546053a771f4ea3ef850efb3be970ea)
Diffstat (limited to 'source3/nmbd/nmbd_winsserver.c')
-rw-r--r--source3/nmbd/nmbd_winsserver.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c
index afc8741366..d089686917 100644
--- a/source3/nmbd/nmbd_winsserver.c
+++ b/source3/nmbd/nmbd_winsserver.c
@@ -808,20 +808,17 @@ is one of our (WINS server) names. Denying registration.\n", namestr(question) )
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 first IP address of the name owner 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 = *namerec->ip;
-
- query_name( subrec, question->name, question->name_type,
+ query_name_from_wins_server( *namerec->ip, question->name, question->name_type,
wins_register_query_success,
wins_register_query_fail,
userdata);
- subrec->bcast_ip = ipzero;
return;
}