From aa985bdee09e222f9f3f1f49e1cc20e0760c6f32 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 31 Jan 2005 04:15:58 +0000 Subject: r5118: added support for node status replies in nbtd. nmblookup -S now works against Samba4. Also added support for the '*' wildcard name (This used to be commit 2dd7ccf72444db668fa970c3a95de1448baea224) --- source4/nbt_server/query.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'source4/nbt_server/query.c') diff --git a/source4/nbt_server/query.c b/source4/nbt_server/query.c index c962a691c6..859a9c7f26 100644 --- a/source4/nbt_server/query.c +++ b/source4/nbt_server/query.c @@ -25,15 +25,6 @@ #include "system/network.h" #include "nbt_server/nbt_server.h" -/* check a condition on an incoming packet */ -#define NBT_ASSERT_PACKET(packet, src_address, test) do { \ - if (!(test)) { \ - nbt_bad_packet(packet, src_address, #test); \ - return; \ - } \ -} while (0) - - /* send a name query reply */ @@ -92,6 +83,13 @@ void nbt_request_query(struct nbt_name_socket *nbtsock, struct nbt_iface_name *iname; struct nbt_name *name; + /* see if its a node status query */ + if (packet->qdcount == 1 && + packet->questions[0].question_type == NBT_QTYPE_STATUS) { + nbt_query_status(nbtsock, packet, src_address, src_port); + return; + } + /* if its a WINS query then direct to our WINS server */ if ((packet->operation & NBT_FLAG_RECURSION_DESIRED) && !(packet->operation & NBT_FLAG_BROADCAST)) { -- cgit