summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2018-02-04 12:16:14 +0000
committerStefan Metzmacher <metze@samba.org>2018-04-13 18:14:41 +0200
commit5fea3e3f23cf75e111b9043ddad8a93aad6c06bf (patch)
tree9006f3d59b96dc163b980110369545ee57e3c498 /libcli
parentce63db26a1d9fd2272e7d708965557d0461a4eac (diff)
downloadsamba-5fea3e3f23cf75e111b9043ddad8a93aad6c06bf.tar.gz
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>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/nbt/namequery.c4
-rw-r--r--libcli/nbt/namerefresh.c2
-rw-r--r--libcli/nbt/nameregister.c2
-rw-r--r--libcli/nbt/namerelease.c2
-rw-r--r--libcli/nbt/nbt_proto.h3
-rw-r--r--libcli/nbt/nbtsocket.c5
6 files changed, 10 insertions, 8 deletions
diff --git a/libcli/nbt/namequery.c b/libcli/nbt/namequery.c
index e344235faa8..49ab10c3c02 100644
--- a/libcli/nbt/namequery.c
+++ b/libcli/nbt/namequery.c
@@ -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,
io->in.dest_addr, io->in.dest_port);
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);
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,
io->in.dest_addr, io->in.dest_port);
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);
if (req == NULL) goto failed;
diff --git a/libcli/nbt/namerefresh.c b/libcli/nbt/namerefresh.c
index b525356c747..b3aef76a5c6 100644
--- a/libcli/nbt/namerefresh.c
+++ b/libcli/nbt/namerefresh.c
@@ -72,7 +72,7 @@ struct nbt_name_request *nbt_name_refresh_send(struct nbt_name_socket *nbtsock,
nbtsock->sock->backend_name,
io->in.dest_addr, io->in.dest_port);
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);
if (req == NULL) goto failed;
diff --git a/libcli/nbt/nameregister.c b/libcli/nbt/nameregister.c
index ff5418c85e5..8e8271d5731 100644
--- a/libcli/nbt/nameregister.c
+++ b/libcli/nbt/nameregister.c
@@ -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,
io->in.dest_addr, io->in.dest_port);
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);
if (req == NULL) goto failed;
diff --git a/libcli/nbt/namerelease.c b/libcli/nbt/namerelease.c
index 8f4698169d8..68c8252078b 100644
--- a/libcli/nbt/namerelease.c
+++ b/libcli/nbt/namerelease.c
@@ -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,
io->in.dest_addr, io->in.dest_port);
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);
if (req == NULL) goto failed;
diff --git a/libcli/nbt/nbt_proto.h b/libcli/nbt/nbt_proto.h
index 281ce25a864..e6ee46bab86 100644
--- a/libcli/nbt/nbt_proto.h
+++ b/libcli/nbt/nbt_proto.h
@@ -33,7 +33,8 @@
/* 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 nbt_name_packet *request,
int timeout, int retries,
diff --git a/libcli/nbt/nbtsocket.c b/libcli/nbt/nbtsocket.c
index 711e39cbdc5..94ec4627d80 100644
--- a/libcli/nbt/nbtsocket.c
+++ b/libcli/nbt/nbtsocket.c
@@ -367,7 +367,8 @@ failed:
/*
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 nbt_name_packet *request,
int timeout, int retries,
@@ -377,7 +378,7 @@ struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock,
int id;
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;
req->nbtsock = nbtsock;