From 0487eee93a06c8d4d1925660d6d14374c4039d86 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 11 Feb 2005 23:54:37 +0000 Subject: r5346: - a bit more preparation for the WINS server going in - more NBT packet asserts, to ensure that incoming requests have all the elements we depend on - open the WINS database at startup if we are configured as a WINS server - split out the nbtd server reply packet generation code so it can be shared by the WINS server - re-did the logic of what is answered by the WINS server and what by the B node server. It now always tries to answer by the B node, and only "recurses" to the WINS server for names that are not found. (This used to be commit 5613e6b8ad9b32639caf5055f793dbc4d0a2fc19) --- source4/nbt_server/interfaces.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'source4/nbt_server/interfaces.c') diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c index 42572614f2..bc01ac6d99 100644 --- a/source4/nbt_server/interfaces.c +++ b/source4/nbt_server/interfaces.c @@ -34,23 +34,13 @@ static void nbtd_request_handler(struct nbt_name_socket *nbtsock, struct nbt_name_packet *packet, const char *src_address, int src_port) { - /* if its a WINS query then direct to our WINS server if we - are running one */ - if ((packet->operation & NBT_FLAG_RECURSION_DESIRED) && - !(packet->operation & NBT_FLAG_BROADCAST) && - lp_wins_support()) { - nbtd_query_wins(nbtsock, packet, src_address, src_port); - return; - } - /* see if its from one of our own interfaces - if so, then ignore it */ if (nbtd_self_packet(nbtsock, packet, src_address, src_port)) { DEBUG(10,("Ignoring self packet from %s:%d\n", src_address, src_port)); return; } - /* the request is to us in our role as a B node */ - switch ((enum nbt_opcode)(packet->operation & NBT_OPCODE)) { + switch (packet->operation & NBT_OPCODE) { case NBT_OPCODE_QUERY: nbtd_request_query(nbtsock, packet, src_address, src_port); break; @@ -61,6 +51,11 @@ static void nbtd_request_handler(struct nbt_name_socket *nbtsock, nbtd_request_defense(nbtsock, packet, src_address, src_port); break; + case NBT_OPCODE_RELEASE: + case NBT_OPCODE_MULTI_HOME_REG: + nbtd_winsserver_request(nbtsock, packet, src_address, src_port); + break; + default: nbtd_bad_packet(packet, src_address, "Unexpected opcode"); break; -- cgit