summaryrefslogtreecommitdiff
path: root/source4/nbt_server/query.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-02-02 10:29:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:28 -0500
commit77cdd7c0ff182f77b1edb032f8d8cd172bdff7ce (patch)
tree45672dee8ae3b030d2e0fada04b9da3d8ae06b3b /source4/nbt_server/query.c
parent96f02f7403a94e0b674e57cfd50f91cf763c7c5c (diff)
downloadsamba-77cdd7c0ff182f77b1edb032f8d8cd172bdff7ce.tar.gz
samba-77cdd7c0ff182f77b1edb032f8d8cd172bdff7ce.tar.bz2
samba-77cdd7c0ff182f77b1edb032f8d8cd172bdff7ce.zip
r5171: added support for "bind interfaces only" in nbtd. The solution was to
bind twice on each interface, once using the broadcast address and once using the specific IP. We then only listen on the wildcard address if we don't have "bind interface only" set. This also happens to simplify the code that finds the right interface for an incoming request. (This used to be commit b3edf17281c5d82abb40dab817bf2de43f9f6c3f)
Diffstat (limited to 'source4/nbt_server/query.c')
-rw-r--r--source4/nbt_server/query.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source4/nbt_server/query.c b/source4/nbt_server/query.c
index 2d2e75d51e..6dab18cfbe 100644
--- a/source4/nbt_server/query.c
+++ b/source4/nbt_server/query.c
@@ -81,9 +81,10 @@ void nbt_request_query(struct nbt_name_socket *nbtsock,
struct nbt_name_packet *packet,
const char *src_address, int src_port)
{
- struct nbt_interface *iface;
struct nbt_iface_name *iname;
struct nbt_name *name;
+ struct nbt_interface *iface = talloc_get_type(nbtsock->incoming.private,
+ struct nbt_interface);
/* see if its a node status query */
if (packet->qdcount == 1 &&
@@ -99,9 +100,6 @@ void nbt_request_query(struct nbt_name_socket *nbtsock,
return;
}
- /* find the interface for this query */
- iface = nbt_iface_find(nbtsock, src_address);
-
NBT_ASSERT_PACKET(packet, src_address, packet->qdcount == 1);
NBT_ASSERT_PACKET(packet, src_address, packet->questions[0].question_type == NBT_QTYPE_NETBIOS);
NBT_ASSERT_PACKET(packet, src_address, packet->questions[0].question_class == NBT_QCLASS_IP);