summaryrefslogtreecommitdiff
path: root/source/utils
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-06 16:26:56 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:48:21 +0100
commit7de55cde7c7fe0141c05c8a38248667ebf3a9033 (patch)
treeb7248f56f4a6dd5f37578953ef088817fa554292 /source/utils
parentbd2d6e0595c7ef897bbc6fdea50b96a7c1b94031 (diff)
downloadsamba-7de55cde7c7fe0141c05c8a38248667ebf3a9033.tar.gz
r26309: Move specification of port higher up the all stack.
Diffstat (limited to 'source/utils')
-rw-r--r--source/utils/nmblookup.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/utils/nmblookup.c b/source/utils/nmblookup.c
index ada5b839b70..2ff758d3b06 100644
--- a/source/utils/nmblookup.c
+++ b/source/utils/nmblookup.c
@@ -29,6 +29,7 @@
#include "lib/socket/netif.h"
#include "librpc/gen_ndr/nbt.h"
#include "libcli/nbt/libnbt.h"
+#include "param/param.h"
/* command line options */
static struct {
@@ -142,6 +143,7 @@ static bool do_node_status(struct nbt_name_socket *nbtsock,
/* do a single node query */
static NTSTATUS do_node_query(struct nbt_name_socket *nbtsock,
const char *addr,
+ uint16_t port,
const char *node_name,
enum nbt_name_type node_type,
bool broadcast)
@@ -154,6 +156,7 @@ static NTSTATUS do_node_query(struct nbt_name_socket *nbtsock,
io.in.name.type = node_type;
io.in.name.scope = NULL;
io.in.dest_addr = addr;
+ io.in.dest_port = port;
io.in.broadcast = broadcast;
io.in.wins_lookup = options.wins_lookup;
io.in.timeout = 1;
@@ -232,15 +235,18 @@ static bool process_one(const char *name)
}
if (options.broadcast_address) {
- status = do_node_query(nbtsock, options.broadcast_address, node_name, node_type, true);
+ status = do_node_query(nbtsock, options.broadcast_address, lp_nbt_port(global_loadparm),
+ node_name, node_type, true);
} else if (options.unicast_address) {
- status = do_node_query(nbtsock, options.unicast_address, node_name, node_type, false);
+ status = do_node_query(nbtsock, options.unicast_address,
+ lp_nbt_port(global_loadparm), node_name, node_type, false);
} else {
int i, num_interfaces = iface_count();
for (i=0;i<num_interfaces;i++) {
const char *bcast = iface_n_bcast(i);
if (bcast == NULL) continue;
- status = do_node_query(nbtsock, bcast, node_name, node_type, true);
+ status = do_node_query(nbtsock, bcast, lp_nbt_port(global_loadparm),
+ node_name, node_type, true);
if (NT_STATUS_IS_OK(status)) break;
}
}