summaryrefslogtreecommitdiff
path: root/source4/utils/nmblookup.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-10 18:41:29 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:49:12 +0100
commit51ef1b606fe1853b7ca2decf2a74eecf18c5a747 (patch)
treeb41373777ada6d38c814cc85a539fb07bab29943 /source4/utils/nmblookup.c
parent5f4842cf65ce64bfdf577cd549565da20ca818cf (diff)
downloadsamba-51ef1b606fe1853b7ca2decf2a74eecf18c5a747.tar.gz
samba-51ef1b606fe1853b7ca2decf2a74eecf18c5a747.tar.bz2
samba-51ef1b606fe1853b7ca2decf2a74eecf18c5a747.zip
r26377: Specify port explicitly.
(This used to be commit 8c767ca13906966cd6cccbeaef3c50033d46f206)
Diffstat (limited to 'source4/utils/nmblookup.c')
-rw-r--r--source4/utils/nmblookup.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/utils/nmblookup.c b/source4/utils/nmblookup.c
index a3e33e2748..1471dfb5b7 100644
--- a/source4/utils/nmblookup.c
+++ b/source4/utils/nmblookup.c
@@ -104,7 +104,7 @@ static char *node_status_flags(TALLOC_CTX *mem_ctx, uint16_t flags)
/* do a single node status */
static bool do_node_status(struct nbt_name_socket *nbtsock,
- const char *addr)
+ const char *addr, uint16_t port)
{
struct nbt_name_status io;
NTSTATUS status;
@@ -113,6 +113,7 @@ static bool do_node_status(struct nbt_name_socket *nbtsock,
io.in.name.type = NBT_NAME_CLIENT;
io.in.name.scope = NULL;
io.in.dest_addr = addr;
+ io.in.dest_port = port;
io.in.timeout = 1;
io.in.retries = 2;
@@ -172,7 +173,7 @@ static NTSTATUS do_node_query(struct nbt_name_socket *nbtsock,
io.out.name.type);
}
if (options.node_status && io.out.num_addrs > 0) {
- do_node_status(nbtsock, io.out.reply_addrs[0]);
+ do_node_status(nbtsock, io.out.reply_addrs[0], port);
}
return status;
@@ -229,7 +230,7 @@ static bool process_one(struct loadparm_context *lp_ctx, const char *name, int n
}
if (options.lookup_by_ip) {
- ret = do_node_status(nbtsock, name);
+ ret = do_node_status(nbtsock, name, nbt_port);
talloc_free(tmp_ctx);
return ret;
}