summaryrefslogtreecommitdiffstats
path: root/source4/libcli/nbt/nbtsocket.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-02-07 11:56:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:35 -0500
commitfcb78064bf760ab72d213b604cef9688edf42b92 (patch)
treec945ba52f9b23745d391acf8a1bdbf8439d01abd /source4/libcli/nbt/nbtsocket.c
parentd09311baa72c0ffa6768a379053dc0bfd38ecbdb (diff)
downloadsamba-fcb78064bf760ab72d213b604cef9688edf42b92.tar.gz
samba-fcb78064bf760ab72d213b604cef9688edf42b92.tar.xz
samba-fcb78064bf760ab72d213b604cef9688edf42b92.zip
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)
Diffstat (limited to 'source4/libcli/nbt/nbtsocket.c')
-rw-r--r--source4/libcli/nbt/nbtsocket.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source4/libcli/nbt/nbtsocket.c b/source4/libcli/nbt/nbtsocket.c
index 3567224deac..f6566e8a6ec 100644
--- a/source4/libcli/nbt/nbtsocket.c
+++ b/source4/libcli/nbt/nbtsocket.c
@@ -309,6 +309,8 @@ struct nbt_name_socket *nbt_name_socket_init(TALLOC_CTX *mem_ctx,
status = socket_create("ip", SOCKET_TYPE_DGRAM, &nbtsock->sock, 0);
if (!NT_STATUS_IS_OK(status)) goto failed;
+ socket_set_option(nbtsock->sock, "SO_BROADCAST", "1");
+
talloc_steal(nbtsock, nbtsock->sock);
nbtsock->idr = idr_init(nbtsock);
@@ -388,10 +390,6 @@ struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock,
DLIST_ADD_END(nbtsock->send_queue, req, struct nbt_name_request *);
- if (request->operation & NBT_FLAG_BROADCAST) {
- socket_set_option(nbtsock->sock, "SO_BROADCAST", "1");
- }
-
if (DEBUGLVL(10)) {
DEBUG(10,("Queueing nbt packet to %s:%d\n",
req->dest_addr, req->dest_port));