diff options
Diffstat (limited to 'source4/libcli/nbt')
-rw-r--r-- | source4/libcli/nbt/nbtsocket.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source4/libcli/nbt/nbtsocket.c b/source4/libcli/nbt/nbtsocket.c index 3567224dea..f6566e8a6e 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)); |