summaryrefslogtreecommitdiff
path: root/source3/rpc_client/ndr.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_client/ndr.c')
-rw-r--r--source3/rpc_client/ndr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/rpc_client/ndr.c b/source3/rpc_client/ndr.c
index 6433a7d196..4e8634d3b9 100644
--- a/source3/rpc_client/ndr.c
+++ b/source3/rpc_client/ndr.c
@@ -182,6 +182,21 @@ NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli,
}
status = cli_do_rpc_ndr_recv(req, mem_ctx);
+
+ /*
+ * NT_STATUS_IO_TIMEOUT indicates network problem,
+ * tear the connection apart.
+ */
+ if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
+ if (cli->transport->transport == NCACN_IP_TCP ||
+ cli->transport->transport == NCALRPC) {
+ rpccli_close_sock_fd(cli);
+ }
+
+ if (cli->transport->transport == NCACN_NP) {
+ rpccli_close_np_fd(cli);
+ }
+ }
fail:
TALLOC_FREE(frame);
return status;