summaryrefslogtreecommitdiff
path: root/source4/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
commitb84be078c197f9752b53d68c882f4d1b44979b8e (patch)
treebde019464dc96ee6c66837ab90a56ed3a9f6b837 /source4/utils
parentfd1870e4f7370a184850e35a3d83157c664a79de (diff)
downloadsamba-b84be078c197f9752b53d68c882f4d1b44979b8e.tar.gz
samba-b84be078c197f9752b53d68c882f4d1b44979b8e.tar.bz2
samba-b84be078c197f9752b53d68c882f4d1b44979b8e.zip
r26309: Move specification of port higher up the all stack.
(This used to be commit 7de55cde7c7fe0141c05c8a38248667ebf3a9033)
Diffstat (limited to 'source4/utils')
-rw-r--r--source4/utils/nmblookup.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/utils/nmblookup.c b/source4/utils/nmblookup.c
index ada5b839b7..2ff758d3b0 100644
--- a/source4/utils/nmblookup.c
+++ b/source4/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;
}
}