mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
libnbt: Add an explicit "mem_ctx" to name_request_send
Implicitly hanging requests off nbtsock is too inflexible for future use Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
ce63db26a1
commit
5fea3e3f23
@ -56,7 +56,7 @@ _PUBLIC_ struct nbt_name_request *nbt_name_query_send(struct nbt_name_socket *nb
|
|||||||
dest = socket_address_from_strings(packet, nbtsock->sock->backend_name,
|
dest = socket_address_from_strings(packet, nbtsock->sock->backend_name,
|
||||||
io->in.dest_addr, io->in.dest_port);
|
io->in.dest_addr, io->in.dest_port);
|
||||||
if (dest == NULL) goto failed;
|
if (dest == NULL) goto failed;
|
||||||
req = nbt_name_request_send(nbtsock, dest, packet,
|
req = nbt_name_request_send(nbtsock, nbtsock, dest, packet,
|
||||||
io->in.timeout, io->in.retries, false);
|
io->in.timeout, io->in.retries, false);
|
||||||
if (req == NULL) goto failed;
|
if (req == NULL) goto failed;
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ _PUBLIC_ struct nbt_name_request *nbt_name_status_send(struct nbt_name_socket *n
|
|||||||
dest = socket_address_from_strings(packet, nbtsock->sock->backend_name,
|
dest = socket_address_from_strings(packet, nbtsock->sock->backend_name,
|
||||||
io->in.dest_addr, io->in.dest_port);
|
io->in.dest_addr, io->in.dest_port);
|
||||||
if (dest == NULL) goto failed;
|
if (dest == NULL) goto failed;
|
||||||
req = nbt_name_request_send(nbtsock, dest, packet,
|
req = nbt_name_request_send(nbtsock, nbtsock, dest, packet,
|
||||||
io->in.timeout, io->in.retries, false);
|
io->in.timeout, io->in.retries, false);
|
||||||
if (req == NULL) goto failed;
|
if (req == NULL) goto failed;
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ struct nbt_name_request *nbt_name_refresh_send(struct nbt_name_socket *nbtsock,
|
|||||||
nbtsock->sock->backend_name,
|
nbtsock->sock->backend_name,
|
||||||
io->in.dest_addr, io->in.dest_port);
|
io->in.dest_addr, io->in.dest_port);
|
||||||
if (dest == NULL) goto failed;
|
if (dest == NULL) goto failed;
|
||||||
req = nbt_name_request_send(nbtsock, dest, packet,
|
req = nbt_name_request_send(nbtsock, nbtsock, dest, packet,
|
||||||
io->in.timeout, io->in.retries, false);
|
io->in.timeout, io->in.retries, false);
|
||||||
if (req == NULL) goto failed;
|
if (req == NULL) goto failed;
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ struct nbt_name_request *nbt_name_register_send(struct nbt_name_socket *nbtsock,
|
|||||||
dest = socket_address_from_strings(packet, nbtsock->sock->backend_name,
|
dest = socket_address_from_strings(packet, nbtsock->sock->backend_name,
|
||||||
io->in.dest_addr, io->in.dest_port);
|
io->in.dest_addr, io->in.dest_port);
|
||||||
if (dest == NULL) goto failed;
|
if (dest == NULL) goto failed;
|
||||||
req = nbt_name_request_send(nbtsock, dest, packet,
|
req = nbt_name_request_send(nbtsock, nbtsock, dest, packet,
|
||||||
io->in.timeout, io->in.retries, false);
|
io->in.timeout, io->in.retries, false);
|
||||||
if (req == NULL) goto failed;
|
if (req == NULL) goto failed;
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ _PUBLIC_ struct nbt_name_request *nbt_name_release_send(struct nbt_name_socket *
|
|||||||
dest = socket_address_from_strings(packet, nbtsock->sock->backend_name,
|
dest = socket_address_from_strings(packet, nbtsock->sock->backend_name,
|
||||||
io->in.dest_addr, io->in.dest_port);
|
io->in.dest_addr, io->in.dest_port);
|
||||||
if (dest == NULL) goto failed;
|
if (dest == NULL) goto failed;
|
||||||
req = nbt_name_request_send(nbtsock, dest, packet,
|
req = nbt_name_request_send(nbtsock, nbtsock, dest, packet,
|
||||||
io->in.timeout, io->in.retries, false);
|
io->in.timeout, io->in.retries, false);
|
||||||
if (req == NULL) goto failed;
|
if (req == NULL) goto failed;
|
||||||
|
|
||||||
|
@ -33,7 +33,8 @@
|
|||||||
|
|
||||||
/* The following definitions come from ../libcli/nbt/nbtsocket.c */
|
/* The following definitions come from ../libcli/nbt/nbtsocket.c */
|
||||||
|
|
||||||
struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock,
|
struct nbt_name_request *nbt_name_request_send(TALLOC_CTX *mem_ctx,
|
||||||
|
struct nbt_name_socket *nbtsock,
|
||||||
struct socket_address *dest,
|
struct socket_address *dest,
|
||||||
struct nbt_name_packet *request,
|
struct nbt_name_packet *request,
|
||||||
int timeout, int retries,
|
int timeout, int retries,
|
||||||
|
@ -367,7 +367,8 @@ failed:
|
|||||||
/*
|
/*
|
||||||
send off a nbt name request
|
send off a nbt name request
|
||||||
*/
|
*/
|
||||||
struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock,
|
struct nbt_name_request *nbt_name_request_send(TALLOC_CTX *mem_ctx,
|
||||||
|
struct nbt_name_socket *nbtsock,
|
||||||
struct socket_address *dest,
|
struct socket_address *dest,
|
||||||
struct nbt_name_packet *request,
|
struct nbt_name_packet *request,
|
||||||
int timeout, int retries,
|
int timeout, int retries,
|
||||||
@ -377,7 +378,7 @@ struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock,
|
|||||||
int id;
|
int id;
|
||||||
enum ndr_err_code ndr_err;
|
enum ndr_err_code ndr_err;
|
||||||
|
|
||||||
req = talloc_zero(nbtsock, struct nbt_name_request);
|
req = talloc_zero(mem_ctx, struct nbt_name_request);
|
||||||
if (req == NULL) goto failed;
|
if (req == NULL) goto failed;
|
||||||
|
|
||||||
req->nbtsock = nbtsock;
|
req->nbtsock = nbtsock;
|
||||||
|
Loading…
Reference in New Issue
Block a user