struct socket_address *server;
const char *target_hostname;
enum dcerpc_transport_t transport;
+ struct socket_address *client;
};
return;
}
+ s->client = socket_get_my_addr(s->socket_ctx, s);
+ if (s->client == NULL) {
+ talloc_free(sock);
+ composite_error(c, NT_STATUS_NO_MEMORY);
+ return;
+ }
sock_fd = socket_get_fd(s->socket_ctx);
sock->peer_addr = socket_get_peer_addr(s->socket_ctx, sock);
if (sock->peer_addr == NULL) {
return c;
}
-
-static NTSTATUS dcerpc_pipe_open_socket_recv(struct composite_context *c)
+static NTSTATUS dcerpc_pipe_open_socket_recv(struct composite_context *c,
+ TALLOC_CTX *mem_ctx,
+ struct socket_address **localaddr)
{
NTSTATUS status = composite_wait(c);
+ if (NT_STATUS_IS_OK(status)) {
+ struct pipe_open_socket_state *s =
+ talloc_get_type_abort(c->private_data,
+ struct pipe_open_socket_state);
+
+ if (localaddr != NULL) {
+ *localaddr = talloc_move(mem_ctx, &s->client);
+ }
+ }
+
talloc_free(c);
return status;
}
c->private_data, struct pipe_tcp_state);
/* receive result socket open request */
- c->status = dcerpc_pipe_open_socket_recv(ctx);
+ c->status = dcerpc_pipe_open_socket_recv(ctx, NULL, NULL);
if (!NT_STATUS_IS_OK(c->status)) {
/* something went wrong... */
DEBUG(0, ("Failed to connect host %s (%s) on port %d - %s.\n",
struct composite_context *c = talloc_get_type_abort(
ctx->async.private_data, struct composite_context);
- c->status = dcerpc_pipe_open_socket_recv(ctx);
+ c->status = dcerpc_pipe_open_socket_recv(ctx, NULL, NULL);
if (NT_STATUS_IS_OK(c->status)) {
composite_done(c);
return;
struct composite_context *c = talloc_get_type_abort(
ctx->async.private_data, struct composite_context);
- c->status = dcerpc_pipe_open_socket_recv(ctx);
+ c->status = dcerpc_pipe_open_socket_recv(ctx, NULL, NULL);
if (!composite_is_ok(c)) return;
composite_done(c);