From fcb78064bf760ab72d213b604cef9688edf42b92 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 7 Feb 2005 11:56:34 +0000 Subject: r5260: - show an error message on nmblookup failure - always try to enable broadcast on nbt name sockets (this matches samba3 behaviour better) (This used to be commit 919bc14e7bbc04479cf11f7a7fd4c5e46616ef46) --- source4/utils/nmblookup.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source4/utils') diff --git a/source4/utils/nmblookup.c b/source4/utils/nmblookup.c index 3e3a4415d5..f41ab4cc6e 100644 --- a/source4/utils/nmblookup.c +++ b/source4/utils/nmblookup.c @@ -176,6 +176,7 @@ static void process_one(const char *name) enum nbt_name_type node_type = NBT_NAME_CLIENT; char *node_name, *p; struct nbt_name_socket *nbtsock; + NTSTATUS status; if (options.find_master) { node_type = NBT_NAME_MASTER; @@ -196,7 +197,6 @@ static void process_one(const char *name) nbtsock = nbt_name_socket_init(tmp_ctx, NULL); if (options.root_port) { - NTSTATUS status; status = socket_listen(nbtsock->sock, "0.0.0.0", NBT_NAME_SERVICE_PORT, 0, 0); if (!NT_STATUS_IS_OK(status)) { printf("Failed to bind to local port 137 - %s\n", nt_errstr(status)); @@ -211,18 +211,22 @@ static void process_one(const char *name) } if (options.broadcast_address) { - do_node_query(nbtsock, options.broadcast_address, node_name, node_type, True); + status = do_node_query(nbtsock, options.broadcast_address, node_name, node_type, True); } else if (options.unicast_address) { - do_node_query(nbtsock, options.unicast_address, node_name, node_type, False); + status = do_node_query(nbtsock, options.unicast_address, node_name, node_type, False); } else { int i, num_interfaces = iface_count(); for (i=0;i