summaryrefslogtreecommitdiff
path: root/source4/nbt_server/interfaces.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-02-11 23:54:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:44 -0500
commit0487eee93a06c8d4d1925660d6d14374c4039d86 (patch)
tree94c251edd48c5996aa831f8378459079e01939c5 /source4/nbt_server/interfaces.c
parent801889f71af52d8d136656ec1100364c50c1626d (diff)
downloadsamba-0487eee93a06c8d4d1925660d6d14374c4039d86.tar.gz
samba-0487eee93a06c8d4d1925660d6d14374c4039d86.tar.bz2
samba-0487eee93a06c8d4d1925660d6d14374c4039d86.zip
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)
Diffstat (limited to 'source4/nbt_server/interfaces.c')
-rw-r--r--source4/nbt_server/interfaces.c17
1 files changed, 6 insertions, 11 deletions
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;